...

View Full Version : How to search a string for a specified string?



kaisellgren
06-14-2006, 11:27 PM
Hey guys,

How would I search a string for a text like:

$string = "My string goes here, do you see?";
$search = " h";

if php_super_cool_search_function($string,$search) > 0
echo ("found!");
else
echo ("nothing found, sorry");

What could be the php_super_cool_search_function?

Thanks!

Kid Charming
06-14-2006, 11:41 PM
strpos() (http://us2.php.net/manual/en/function.strpos.php). Be sure to read the specs before using.

kaisellgren
06-15-2006, 12:26 PM
Thanks a lot. Have you any good tip how to find functions in PHP manual? If I need something, I really have no idea how do I need to search the PHP manual...

Kid Charming
06-15-2006, 05:00 PM
There's a search box on php.net that lets you search their function list directly; it's in the upper-right corner.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum