On Tuesday 26 April 2005 06:55, Brian Dunning wrote:
> Hi all - it seems the longer I use PHP, the stupider my questions are
> getting. I finally got my XML parsed into an array, but perhaps my
> skills at dealing with the array are not where I thought they were.
> My array print_r's out like this:
>
> Array
> (
>    [PARAS] => Array
>      (
>        [PARA] => Array
>          (
>            [__multi] => 1
>              [0] => Array
>                (
>                  [NOTE] => Here is my first note.
>                  [TITLE] => Here is my first title.
>                )
>              [1] => Array
>                (
>                  [NOTE] => Here is my second note.
>                  [TITLE] => Here is my second title.
>                )
>          )
>      )
> )
>
> I just want to loop through the array and output it as a table. It
> would look something like this:
>
> <td>Here is my first note.</td><td>Here is my first title.</td>
> <td>Here is my second note.</td><td>Here is my second title.</td>

Use 'foreach' (http://www.php.net/foreach) to loop through the arrays and 
check each member of the array with the function 
'is_array' (http://www.php.net/is_array) to see if it's been a XML parameter 
or XML child element.

>
> What incredibly easy way to do this am I just missing? Thanks!  :)

-- 

Cyberly yours,
Petar Nedyalkov
Devoted Orbitel Fan :-)

PGP ID: 7AE45436
PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc
PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436

Attachment: pgpWuEGmW6Scn.pgp
Description: PGP signature

Reply via email to