Re: [PHP] UNSET & Arrays
I was doing something wrong... ;) I figured it out. Sorry for the post -- it was one of those things that took me *forever* to figure it out and when I saw the problem I felt like an idiot -- oh well. Thanks anyway. Jason "Jason Wong" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Friday 07 June 2002 09:04, Jason Caldwell wrote: > > i'm trying to unset an array element within my array -- > > > > my array looks like; > > > > $foo[0][magazine] > > $foo[0][subscription] > > $foo[0][term] > > $foo[0][rate] > > > > $foo[1][magazine] > > $foo[1][subscription] > > $foo[1][term] > > $foo[1][rate] > > > > and so forth -- > > > > when i call unset($foo[0]) for example, the entire array goes away, not > > just the [0] elements. > > > > how can i unset a multi-dimensional array? i have no problems using unset > > single-dimension arrays. > > You must be doing something wrong. unset($foo[0]) is correct and should work. > If you're still having problems, post your real code. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > The value of a program is proportional to the weight of its output. > */ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] UNSET & Arrays
On Friday 07 June 2002 09:04, Jason Caldwell wrote: > i'm trying to unset an array element within my array -- > > my array looks like; > > $foo[0][magazine] > $foo[0][subscription] > $foo[0][term] > $foo[0][rate] > > $foo[1][magazine] > $foo[1][subscription] > $foo[1][term] > $foo[1][rate] > > and so forth -- > > when i call unset($foo[0]) for example, the entire array goes away, not > just the [0] elements. > > how can i unset a multi-dimensional array? i have no problems using unset > single-dimension arrays. You must be doing something wrong. unset($foo[0]) is correct and should work. If you're still having problems, post your real code. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* The value of a program is proportional to the weight of its output. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] UNSET & Arrays
that didn't work. "Mark" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... first try quoting your strings and see if that helps :) $foo[0]["magazine"] On Thu, 6 Jun 2002 18:04:47 -0700, Jason Caldwell wrote: >i'm trying to unset an array element within my array -- > >my array looks like; > >$foo[0][magazine] >$foo[0][subscription] >$foo[0][term] >$foo[0][rate] > >$foo[1][magazine] >$foo[1][subscription] >$foo[1][term] >$foo[1][rate] > >and so forth -- > >when i call unset($foo[0]) for example, the entire array goes away, >not just >the [0] elements. > >how can i unset a multi-dimensional array? i have no problems using >unset >single-dimension arrays. > >thanks >jason > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] UNSET & Arrays
first try quoting your strings and see if that helps :) $foo[0]["magazine"] On Thu, 6 Jun 2002 18:04:47 -0700, Jason Caldwell wrote: >i'm trying to unset an array element within my array -- > >my array looks like; > >$foo[0][magazine] >$foo[0][subscription] >$foo[0][term] >$foo[0][rate] > >$foo[1][magazine] >$foo[1][subscription] >$foo[1][term] >$foo[1][rate] > >and so forth -- > >when i call unset($foo[0]) for example, the entire array goes away, >not just >the [0] elements. > >how can i unset a multi-dimensional array? i have no problems using >unset >single-dimension arrays. > >thanks >jason > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] UNSET & Arrays
i'm trying to unset an array element within my array -- my array looks like; $foo[0][magazine] $foo[0][subscription] $foo[0][term] $foo[0][rate] $foo[1][magazine] $foo[1][subscription] $foo[1][term] $foo[1][rate] and so forth -- when i call unset($foo[0]) for example, the entire array goes away, not just the [0] elements. how can i unset a multi-dimensional array? i have no problems using unset single-dimension arrays. thanks jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php