Okay, how about:
<?php
// Create arrays that are the same size as the highest numbered page in each section (10 and 41 respectively)
$a1_pages = array_pad(array(), 10, 0);
$b1_pages = array_pad(array(), 41, 0);
// Choose a random number from the array and str_pad it to put leading zeroes on the single digits
$a1_include = "A1_" . str_pad(rand(1, count($a1_pages)), 2, '0', STR_PAD_LEFT) . ".htm";
$b1_include = "B1_" . str_pad(rand(1, count($b1_pages)), 2, '0', STR_PAD_LEFT) . ".htm";
?>
<table>
<tr>
<td><?php include($a1_include); ?></td>
<td><?php include($b1_include); ?></td>
</tr>
</table>
Main Topics
Browse All Topics





by: VGRPosted on 2003-07-09 at 07:13:45ID: 8885558
<?php efix,$numb er) { "; le");
,'A',6); ,'A',6);
function includerand($directory,$pr
$i=rand(0,$number); // returns integer in [0 ... $number]
if (strlen($i)<2) $i="0$i";
$thefile="{$prefix}_$i.htm
include("$directory/$thefi
} // includerand Procedure
includerand('pagename_inc'
includerand('pagename_inc'
?>