Re: problem with if and exact match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/15/2011 07:30 AM, Steve Staples wrote:
> 
> Wouldn't this be better to use, as it is meant to search for the string
> inside the string?  (use use regex)
> 
> if(stristr($name, 'Jackson'))
> {
> 	echo "String is in String";
> }
> else
> {
> 	echo "Failed";
> }
> 
> http://ca.php.net/manual/en/function.strstr.php  (case sensative)
> http://ca.php.net/manual/en/function.stristr.php (case insensative)
> 
> Steve.
> 


>From your link:

    Note:

    If you only want to determine if a particular needle occurs within
haystack, use the faster and less memory intensive function strpos()
instead.


-- 
Thanks!
-Shawn
http://www.spidean.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux