You can have arrays of arrays of arrays of arrays if you like.  But you
must treat each array according to its type.  I'm not sure what your
function parse() is doing, but I assume it's going to build three
list-type arrays.  So when your looping through the associative array
with a foreach() loop you'll access each list with a for() loop.

// Loop through the associative array and echo list contents...
foreach ($my_associative_array_of_list_arrays as $title => $list)
{
        echo "<p>" . $title . ": <br>";
        for ($i=0; $i<count($list); $i++)
        {
                echo $list[$i] . "<br>";
        }
}

Unless you're going to access the list arrays by title (ie
$applist[URL]) then there really isn't a point in using the associative
array.  Just put everything into a 2D list array and access them with a
double for() loop.

Hope this points you in the right direction.

--
Kevin Stone
[EMAIL PROTECTED]
www.helpelf.com

> -----Original Message-----
> From: Sandeep Murphy [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 01, 2002 8:03 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Associative arrays... help
> 
> Hi,
> 
> sorry for repeating this...didnt change the sub..:)
> Is there any way I can  construct an associative array out of 3 other
> arrays??
> 
> like for eg.
> 
> function parse() {
> 
> appid[];
> appnm[];
> url[];
> }
> 
> I want to do something like this:
> 
> function arr() {
> 
> 
> $applist = array("APPID" =>$appid,
>                         "APP NAME"=>$appnm,
>                          "URL" =>$url);
> 
> foreach($applist as $valor)
> 
> echo $key . $valor;
> }
> 
> wud appreciate any help..
> 
> TIA,
> sands
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
[EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to