Re: [PHP] Array - partical path to the array's path (part 2)

2005-10-03 Thread Scott Fletcher
Got it figured out by now. I noticed one small bug but I'll fix it monday morning, so i'm going to post what I did to make this work.. I'm going to donate this code to the guy at http://www.devdump.com/phpxml.php and hopefully he'll put some of this to a good use as more and more people are now u

Re: [PHP] Array - partical path to the array's path (part 2)

2005-09-29 Thread Scott Fletcher
> the xml above is not structurally > the same as the array below > > I'll bet your output has just one message > element right? or you have gone completely offtrack. > > might be time you went here: > > http://php.net/xml > http://php.net/dom > http://php.net/domxml > > might be something the

Re: [PHP] Array - partical path to the array's path (part 2)

2005-09-28 Thread Jochem Maas
Scott Fletcher wrote: Aw!!! This is driving me nut... It still does :-) get to grips with var_dump() ... Um Interesting thought... ($array.$suffix) will never be an array $suffix .= "['".$key."']"; Yea, you are correct... I was trying to integrate the coding and stumpl

Re: [PHP] Array - partical path to the array's path (part 2)

2005-09-28 Thread Scott Fletcher
> Aw!!! This is driving me nut... It still does :-) > get to grips with var_dump() ... Um Interesting thought... > ($array.$suffix) will never be an array > $suffix .= "['".$key."']"; Yea, you are correct... I was trying to integrate the coding and stumpled upon this. It's a mind

Re: [PHP] Array - partical path to the array's path (part 2)

2005-09-28 Thread Jochem Maas
Scott Fletcher wrote: To the top... Aw!!! This is driving me nut... I can't get it to do what I want it to do... Also, another problem is that we're all not thinking at the same level so I'll just dump the simple code so you all can see what I'm trying to do... [code] fantastic function -

Re: [PHP] Array - partical path to the array's path (part 2)

2005-09-28 Thread Scott Fletcher
To the top... Aw!!! This is driving me nut... I can't get it to do what I want it to do... Also, another problem is that we're all not thinking at the same level so I'll just dump the simple code so you all can see what I'm trying to do... [code] function getVal($arr, $path) { $retval

Re: [PHP] Array - partical path to the array's path....

2005-09-27 Thread Scott Fletcher
see below... "Jochem Maas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > see below.. > > Scott Fletcher wrote: > > "Jochem Maas" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > >>Mike Dunlop wrote: > >> > >>>On Sep 27, 2005, at 10:22 AM, Scott Fletcher wrote:

Re: [PHP] Array - partical path to the array's path....

2005-09-27 Thread Scott Fletcher
:-) "Mike Dunlop" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > My bad - that doesn't work - that came off the top off my head. It > sure did look sexy though, no ? > > - MD > > > >> echo ${"array".$prefix}; > >> > > > > really? did you test that? > > doesn't work when I do it (t

Re: [PHP] Array - partical path to the array's path....

2005-09-27 Thread Mike Dunlop
My bad - that doesn't work - that came off the top off my head. It sure did look sexy though, no ? - MD echo ${"array".$prefix}; really? did you test that? doesn't work when I do it (the second expression does - but doesn't answer the OPs question actually imho the answer is not eval() e

Re: [PHP] Array - partical path to the array's path....

2005-09-27 Thread Jochem Maas
see below.. Scott Fletcher wrote: "Jochem Maas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Mike Dunlop wrote: On Sep 27, 2005, at 10:22 AM, Scott Fletcher wrote: [code] $array = array(); $array['col1']['col2'] = "Test #1"; $array['col3']['col2'] = "Test #2"; $prefix

Re: [PHP] Array - partical path to the array's path....

2005-09-27 Thread Scott Fletcher
"Jochem Maas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Mike Dunlop wrote: > > On Sep 27, 2005, at 10:22 AM, Scott Fletcher wrote: > > > >> [code] > >> $array = array(); > >> > >> $array['col1']['col2'] = "Test #1"; > >> $array['col3']['col2'] = "Test #2"; > >> > >> $pre

Re: [PHP] Array - partical path to the array's path....

2005-09-27 Thread Scott Fletcher
Wow, that seem to work... Should have use "$suffix" instead of "$prefix" to make it less confusing. "Silvio Porcellana" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Scott Fletcher wrote: > > >What I want this to work instead is > >[code] > > $array = array(); > > > > $array['co

Re: [PHP] Array - partical path to the array's path....

2005-09-27 Thread Jochem Maas
Mike Dunlop wrote: On Sep 27, 2005, at 10:22 AM, Scott Fletcher wrote: [code] $array = array(); $array['col1']['col2'] = "Test #1"; $array['col3']['col2'] = "Test #2"; $prefix = "['col3']['col2']"; echo $array.$prefix; //Spitted out result as "Test #2"... [/code] This is the simp

Re: [PHP] Array - partical path to the array's path....

2005-09-27 Thread Mike Dunlop
On Sep 27, 2005, at 10:22 AM, Scott Fletcher wrote: [code] $array = array(); $array['col1']['col2'] = "Test #1"; $array['col3']['col2'] = "Test #2"; $prefix = "['col3']['col2']"; echo $array.$prefix; //Spitted out result as "Test #2"... [/code] This is the simple code that I'm try

Re: [PHP] Array - partical path to the array's path....

2005-09-27 Thread Silvio Porcellana
Scott Fletcher wrote: >What I want this to work instead is >[code] > $array = array(); > > $array['col1']['col2'] = "Test #1"; > $array['col3']['col2'] = "Test #2"; > > $prefix = "['col3']['col2']"; > > echo $array.$prefix; //Spitted out result as "Test #2"... >[/code] > > Try something li

[PHP] Array - partical path to the array's path....

2005-09-27 Thread Scott Fletcher
Here is something simple that I want it to work.. Not sure how to do this exactly... Code #1 [code] $array = array(); $array['col1']['col2'] = "Test #1"; $array['col3']['col2'] = "Test #2"; echo $array['col3']['col2']; //Spitted out result as "Test #2"... [/code] What I want this to w