SpriteWood everybody is one single tree « Beauty Doll mpd - Music Player Daemon »

Rand() for images

<?php
echo rand(0, 5);
?>

rand这玩意可以用来生成指定范围内的随机数or字符,于是可以拿来做随机展示图片

<?php
	$domain = 'http://www.fouland.com/';
	echo $domain;
	echo '<img src="' . $domain . '/Path/currentName' . rand(0, 5) . '.gif"';
?>

Tags:

Tuesday, June 3rd, 2008 at 10:10 pmand is filed under php. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

>
  • Categories

  • Recent Posts

  • Recent Comments

  • SpriteWood is proudly powered by WordPress
    Entries (RSS) and Comments (RSS).