RES: [PHP] string
| From: | Thiago Pojda | Date: | Mon, 07 Apr 2008 13:33:39 +0000 |
| Subject: | RES: [PHP] string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-272617@lists.php.net to get a copy of this message | ||
<?php
$name = "John Taylor";
if (strpos($name,'John') > 0){
//you could use stripos for case insensitive search
echo "found";
}
?>
-----Mensagem original-----
De: John Taylor-Johnston [mailto:jt.johnston@USherbrooke.ca]
Enviada em: segunda-feira, 7 de abril de 2008 10:25
Para: PHP-General
Assunto: [PHP] string
$name = "John Taylor";
I want to verify if $name contains "john", if yes echo "found";
Cannot remember which to use:
http://ca.php.net/manual/en/ref.strings.php
Sorry,
John
--
PHP General Mailing List (http://www.php.net/) To unsubscribe,
visit: http://www.php.net/unsub.php