visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: PHP :: Points for VGR, only VGR answer


By: coders4hire U.S.A.  Date: 09/07/2003 00:00:00  English  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 English  Type : Answer
why not :D
thanks
By: coders4hire Date: 09/07/2003 02:39:00 English  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 English  Type : Comment
about the same, but using is_file() also :D

Do register to be able to answer

EContact
browser fav
page generated in 340.395930 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page