Find exact string inside a string
php, string
Solution
You can do this with regex, and surrounding the word with `\b` word boundary
`preg_match("~\bMures\b~",$string)`
example:
$string = 'Maramures';
if ( preg_match("~\bMures\b~",$string) )
echo "matched";
else
echo "no match";
Problem
I have two strings "Mures" and "Maramures". How can I build a search function that when someone searches for Mures it will return him only the posts that contain the "Mures" word and not the one that contain the "Maramures" word. I tried strstr until now but it does now work.