if (ereg("john",$jeff) ) { }

or:

if( strstr( $jeff, "john") ) { }

or:

if( strpos( $jeff, "john") ) { }


-----Original Message-----
From: Warwick Berg [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 6:55 AM
To: [EMAIL PROTECTED]
Subject: [PHP] comparisons


Hi

Just learning php from the bottom. Can someone help with syntax please?

Want to know about using ifs :

If the string value "john" is present in the variable "jeff" then do, etc,
etc. How do we see if a value is present in a string?

Thanks
Warwick




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

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

Reply via email to