Random display by PHP
September 10th, 2010 at 04:35pm Jason 28 views
Sometimes I need to display a Ad or codes Randomly on my website. here is the php code can give out the result, share with you! you can use it for the Ads, Images, Flash…all kinds of codes.
1 2 3 4 5 6 7 8 9 | <?php $ad = array( "Code_1", "Code_2", "Code_3", ); //Random Codes $rand = array_rand($ad); //Get the Random number echo $ad[$rand]; //Display the Code View ?> |
Entry Filed under: WordPress Tagged with: blog code PHP website wordpress
Hot Posts Hot Comments Hot Tags
- apartment bbpress blog class CMS code CSS div dream english friends girl Google hot Hot Dog html job JS life lines love Madonna menu Michael Jackson movie oral english PHP plugin saying school sexy site student students submenu success tags teacher teaching txt university video website widget wordpress





Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">
Trackback this post | Subscribe to the comments via RSS Feed