Page 1 of 1

Substring

Posted: Tue Aug 14, 2007 8:21 am
by shivam0101
Is there any function in php which checks a particular string exsits in main string?

Posted: Tue Aug 14, 2007 8:57 am
by s.dot
strpos() or for PHP5 case insensitive string matching stripos()

Posted: Tue Aug 14, 2007 10:20 am
by shivam0101
it takes the first character, i want to compare something like this,

main string: 'mytable.myname='me' AND mytable.friendname='he'';

substring : mytable.friendname='he';

i want to find whether the main string contains the substring.

Posted: Tue Aug 14, 2007 10:22 am
by feyd
strpos() wrote:Return Values

Returns the position as an integer. If needle is not found, strpos() will return boolean FALSE.