In the following code:
$num = Rand (1,2);
switch ($num)
{
case 1:
$var1 = "first value";
break;
case 2:
$var1 = "second value";
break;
}
My next part of coding needs the $var1 to be included inside an array of Jobs. Any idea how I would do this.
Thanks as always, Cameron.
why not this? code example works for php5.5
code example works for php<5.5