f1 photos mt_rand count photos -1 f2 photos mt_rand count photos -1 if

1
2
3
4
$f1 = $photos[mt_rand(0, count($photos)-1)];
$f2 = $photos[mt_rand(0, count($photos)-1)];
if($f1 == $f2) $f2 = $photos[mt_rand(0, count($photos)-1)];