i have some perl code which i want to get working in a php script. what do i need to change in the following code to get it work in php (i already changed elsif to elseif and the position of rand but it still did not work)
original perl
if($sum[1]<15){$fact2a ="v";}
elseif($sum[1]>15){$fact2a ="c";}
else { $fact2a = ("c", "v")[rand 2]; }
current php which does not work
if($sum[1]<15){$fact2a ="v";}
elseif($sum[1]>15){$fact2a ="c";}
else { $fact2a =rand ("c", "v"); }
it's the rand function that's not working, the first two lines work.