RE: [PHP] search array for value
| From: | Warren Vail | Date: | Tue, 31 Jul 2001 05:04:24 +0000 |
| Subject: | RE: [PHP] search array for value | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-60315@lists.php.net to get a copy of this message | ||
Sorry, mixed this up with your other query;
For this
If(in_array(1, $array)) {
}
Warren Vail
-----Original Message-----
From: Warren Vail [mailto:warren@availabletech.com]
Sent: Monday, July 30, 2001 9:57 PM
To: Matthew Delmarter; PHP Mailing List
Subject: RE: [PHP] search array for value
How about;
$valuelist = explode(", ", $array);
$query = "select * from table where column in ($valuelist)";
etc.....
Warren Vail
-----Original Message-----
From: Matthew Delmarter [mailto:matt@adplusonline.com]
Sent: Monday, July 30, 2001 9:41 PM
To: PHP Mailing List
Subject: [PHP] search array for value
How do I search an array?
For example if I want to know if $array contains "1"...
Regards,
Matthew Delmarter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net