Re: test for multi-dim array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John Pillion wrote:
I'm trying to recursively loop through a multi dimensional array with
unknown keys and unknown values, and echo the keys/values to a sql
statement, where the key is the field, and the value is the. value.

What I want to do is test an array index to see if it has any children
indices (which then need to be looped through again), or if it is the lowest
level child. in which case, the data needs to be extracted.

What is the easiest way to test an array index to see if it has one or more
children? Just doing a count() isn't reliable, as their may only be a single
parent on the highest level.

A combination of is_array and count should be enough.

-Stut

--
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux