[pmwiki-devel] php multi-dimensional array construction problem

Hans design5 at softflow.co.uk
Sat Feb 7 07:20:09 CST 2009


Friday, February 6, 2009, 4:29:06 PM, Daniel wrote:

> //This changes the pointer to the leaf
> foreach($query as $i) {
>         if(isset($pointer[$i]))
>                 $pointer = &$pointer[$i];

Daniel, one big problem popped up with this:

if $pointer[$i] is not set, it will just go to the next key.

But I would like it to be created first, then go to the next key
for the newly created key. That way we will not loose members, but
add them to the chain if they are not there in the first place.
Like having new directories created automatically if the filepath
string contains new names.

Is that possible?


Hans




More information about the pmwiki-devel mailing list