$random_number = str_pad(rand(1, 1000), 4, '0', STR_PAD_LEFT); $random_picture = '<a href="misc.php?do=page&template=ranpic"><img src="images/random/' . $random_number . '.jpg" alt="Click For Next" border="0" /></a>';