Hm....
You are a genious....I knew that this could be done with regexp and I played
with it but now I see I'll have to do a harder studying on that subject :)
The array is now ok but the problem is that the indexes [0] have been
removed and some properties have [0] and [1] like "nameserver" property so
now it shows
[nameserver] => NS2.DOMAINNAME.COM
becuse it overrided the [0] and NS1.DOMAINNAME.COM...
I played with this all evening but I just can't come up with a
solution...the soultion has to be intuitive not hardcoded b/c "we" don't
know which property will have more indexes (which one will be array)....
Can you help here!??
I really appriciate your help and your time....
p.
"Shawn Wilson" <shawn@glassgiant.com> wrote in message
news:3FCF42B7.78E199B0@glassgiant.com...[color=blue]
> point wrote:[color=green]
> >
> > Hi Shawn...
> >
> > Well ..that is the original array...this is the print_r of the array...
> >
> > I got this array by using file() function on a remote file and that's[/color][/color]
what[color=blue][color=green]
> > was returned...I guess I could use readfile() if you think that can help
> > bulding the final array I need...
> >
> > I tried to explode the values on "=" and then put the left side of = to[/color][/color]
keys[color=blue][color=green]
> > and right side to values..meaning
> >
> > [3] => property[created by][0] = hexonet
> >
> > becomes
> > [property[created by][0]] => hexonet
> >
> > and so on...but that's not the "real" array as in this case the
> > "property[created by][0]" part is treated as string not array...and i[/color][/color]
would[color=blue][color=green]
> > like to be treated as array so that with print_r I get the real array
> > structure....and I'm getting headache in the meanwhile :) ...[/color]
>
> Well, you could do this (I'm not sure if I got the regular expression[/color]
correct -[color=blue]
> you may have to tinker with it):
>
> $newarray = array();
>
> foreach($yourarray as $key=>$val) {
> newarray[preg_replace("/^property\[([^\]]+)\].*$/", "\$1", $key)] = $val;
> }
>
> Regards,
> Shawn
> --
> Shawn Wilson
>
shawn@glassgiant.com
>
http://www.glassgiant.com[/color]