$text=" ma mee ma mee meena mia meenaùs";
$text is a string with hundreds of words,above is a short illustration.
what i want is i want to check if the $text contains 'mee' if yes than replace mee with " "(i.e. space).
i am using preg_replace
for the same but as obvious it searches for the pattern mee
and replaces it with space even when the $text
has meena.
in short i want the replacement only when the $text
value is mee not meena.how to achieve this using PREG_REPLACE or related function?
Thanks in advance
$text = preg_replace("mee","", $text);
expected output: "ma ma meena mia meenaùs" there seem to some encoding issue as it is not working for meenaùs