Substring

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shivam0101
Forum Contributor
Posts: 197
Joined: Sat Jun 09, 2007 12:09 am

Substring

Post by shivam0101 »

Is there any function in php which checks a particular string exsits in main string?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

strpos() or for PHP5 case insensitive string matching stripos()
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
shivam0101
Forum Contributor
Posts: 197
Joined: Sat Jun 09, 2007 12:09 am

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

strpos() wrote:Return Values

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