Languages :: PHP :: Points for VGR, only VGR answer |
|||
| By: coders4hire |
Date: 09/07/2003 00:00:00 |
Points: 300 | Status: Answered Quality : Excellent |
|
For random include script: <?php function includerand($directory,$prefix,$number) { $i=rand(0,$number); // returns integer in [0 ... $number] if (strlen($i)<2) $i="0$i"; $thefile="{$prefix}_$i.htm"; include("$directory/$thefile"); } // includerand Procedure includerand('pagename_inc','A',6); includerand('pagename_inc','A',6); ?> |
|||
| By: VGR | Date: 09/07/2003 02:23:00 | Type : Answer |
|
| why not :D thanks |
|||
| By: coders4hire | Date: 09/07/2003 02:39:00 | Type : Comment |
|
| Now I'm curious how you would have rewritten that script to count the files in the directory... |
|||
| By: VGR | Date: 09/07/2003 02:50:00 | Type : Comment |
|
| about the same, but using is_file() also :D |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








