RE: [PHP] Using array_search I get error

From: Date: Sun, 11 Mar 2007 21:58:06 +0000
Subject: RE: [PHP] Using array_search I get error
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-250253@lists.php.net to get a copy of this message
-----Original Message----- From: Stut [mailto:stuttle@gmail.com] Sent: Sunday, March 11, 2007 2:53 PM To: Richard Kurth Cc: php-general@lists.php.net Subject: Re: [PHP] Using array_search I get error Richard Kurth wrote: > This array comes from $_REQUEST of all data submitted > > $array='Array ( [id] => 17 [takeaction] => saveCustomFields [notes] => > -- Feb 4, 2007 @ 9:16 PM --fdsfdsfsdfdsfsfsfds -- Feb 4, 2007 @ 9:21 > PM --fdfdsfsdffsd -- February 11, 2007, @ 9:31 PM -- This is a tes -- > February 14, 2007, @ 10:10 PM -- jhafjhfa afjahfajfhda > kasjdaksdhADSKJL [firstname] => NANCY [lastname] => ADKINS [phone2] => [address1] => 25 ALWARD CT. > [address2] => [city] => MARTINSVILLE [State] => AK [other] => [zip] => > 24112 [country] => US [date18] => 03-13-2007 [text19] => test1 > [text20] => [rating] => 0 [status] => Active )'; when I use > array_search to find date18 > > $key = array_search('date18', $array); // $key = 1; > > I get Wrong datatype for second argument How come the array is wrong > datatype isn't a array an array or am I using this wrong $array is a string, and array_search is expecting an array, so it's correct. Where did you get that "array"? -Stut This array comes from $_REQUEST of all data submitted from a form

« previous php.general (#250253) next »