I want to find out if a string is within another string. I want to see if the needle is in the haystack, so to speak. I'm nearly certain I should be using the strpos() function. But I want to find a string, with spaces and all, not just a single character or group of chars without spaces.
For example:
$needle = "NO-108 J R RAILEY";
$haystack = "B22-V1 / NO-108 J R RAILEY";
// if needle is found in haystack, return true
if (strpos(stripslashes($needle),stripslashes($haystack)))
return true;
else
return false;
This returns false as written. I've clearly written it incorrectly... can anyone clear this up for me? Am I even applying the PHP function correctly?
Thanks,
Mark