well, i've found this useful for many things so i figured i'd post it
PHP Code:
function inStr ($needle, $haystack)
{
$needlechars = strlen($needle); //gets the number of characters in our needle
$i = 0;
for($i=0; $i < strlen($haystack); $i++) //creates a loop for the number of characters in our haystack
{
if(substr($haystack, $i, $needlechars) == $needle) //checks to see if the needle is in this segment of the haystack
{
return TRUE; //if it is return true
}
}
return FALSE; //if not, return false
}
Format for using.
PHP Code:
if(inStr("CodingForums", "The best site ever is CodingForums"))
{
echo "CodingForums is in this string";
}