1
Need some help
Random picture location with correct extention.
In echo '.$random.' returns not the number but the code.
<?php // logic echoing any image url srand ((double) microtime() * 1000000); $randloc = rand(1,2); $random_url = array( "", "/image_loc_1/", "/image_loc_2/", ); $random_img = array( "", ".gif", ".jpg", ); if ($randloc == 1) $random = rand(1,25); else $random .= rand(1,99); echo ''.$random_url[$randloc].''.$random.''.$random_img[$randloc].'" width="140"'; ?>