Re: [PHP] Removing Certain Key==>Val from an array...

2001-09-26 Thread Philip Olson
Here's one way : $bye = 'jennifer lopez'; foreach ($cart as $title => $value) { if (!strcasecmp($value,$bye)) { unset($cart[$title]); break; } } Btw, it's => not ==>, jennifer not jannifer :) regards, Philip Olson On Thu, 27 Sep 2001, Sijan Khadka wrote: > How can we remove

[PHP] Removing Certain Key==>Val from an array...

2001-09-26 Thread Sijan Khadka
How can we remove certain key==>val from an array? Lets say i have an array -- $cart = array ( "Software"==> "Redhat", "Book" ==> "Mastering PHP", "MusicCD" ==> "Jannifer Lopez" ) ; Here I want to remove "MusicCD" ==> "Jannifer Lopez" such that the $cart = array ( "Software"==> "Re