|
-
May 16th, 2005, 11:26 AM
#1
Thread Starter
Fanatic Member
[resolved, i think]Array inside an Array...
ok, i am helping someone out with some php code, but i cannot figure out how to put an array inside an array, i know how to do it in CGI but not php, here is the code:
PHP Code:
<table width="175" height="1" border="0" cellpadding="0" cellspacing="0" class="left">
<tr>
<td height="1" background="images/left_border.gif"><img src="images/spacer" width="175" height="1"></td>
</tr>
<tr>
<td align="center" valign="top">
<img src="images/left_rule.gif" width="170" height="1" vspace="3"></td>
</tr><?
$dir = 'images/left/';
$dh = opendir($dir);
while (false !== ($filename = readdir($dh))) {
if($filename == "Thumbs.db" || is_dir($filename)){
}else{
$files[] = $filename;
}
}
$nooffildi = count($files);
$nooffiles = ($nooffildi-1);
srand((double)microtime()*100000);
for($i=0; $i<=2; $i++){
$randnum[$i] = rand(0,$nooffiles);
while($files[$randnum[$i]] == ""){
$randnum[$i] = rand(0,$nooffiles);
}
//THIS LINE!!!
ecno "<tr>\n
<td align=\"center\" valign=\"top\"><img src=$dir" . //HERE>>// . "$files[$randnum[$i]]" . //<<HERE// . "width=\"175\" border=\"0\" class=\"iborder\"></td>\n
</tr>\n
<tr>\n
<td align=\"center\" valign=\"top\"><img src=\"images/left_rule.gif\" width=\"170\" height=\"1\" vspace=\"3\"></td>\n
</tr>\n";
}
echo "</table>\n";
ALSO, ther //HERE// is only there to show you where i am taling about
Last edited by ALL; May 16th, 2005 at 12:55 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|