note 35547 deleted from control-structures.do.while by vincent
| From: | vincent@php.net | Date: | Sat, 06 Sep 2003 09:30:41 +0000 |
| Subject: | note 35547 deleted from control-structures.do.while by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55531@lists.php.net to get a copy of this message | ||
Note Submitter: Bob Muller
----
Why do I get an error "Fatal error: Maximum execution time of 30 seconds exceeded in
/home/...php on line ..
<?php
function writecollage($lines = "8"){
$rand_file ="collage.htm"; // change to the filename/path of your file with the collage
HTML.
$htmllines = split("\[\[NEW\]\]", join("", file($rand_file)));
$output = NULL;
for($i=0; $i<$lines; $i++) {
do {
if($line == $lastline) continue;
$line = rand(0, sizeof($htmllines)-1);
} while ($line == $lastline);
$output .= $line;
$lastline = $line;
}
return $output;
}
?>
Thank you