Results 1 to 8 of 8

Thread: [resolved, i think]Array inside an Array...

Threaded View

  1. #1

    Thread Starter
    Fanatic Member ALL's Avatar
    Join Date
    Jul 2004
    Location
    192.168.1.1
    Posts
    711

    [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.
    Please support one of my projects?
    TKForums.com

    Web Forum
    JavaScript Wiki
    ________________________
    If somone helps you, please rate their post, by clicking the to rate their post

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width