I hav especific need of removing word from string, But I am having problem when that word has dot (.) character.
Lets see here is the string and what I have tried so far?
$result = 'Hello Ka Kashish.';
$result = preg_replace('/\bKa\b/i', '', $result);
I will get the expected result 'Hello Kashish.'
But if the string is like below, It is not working
$result = 'Hello Ka. Kashish.';
$result = preg_replace('/\bKa.\b/i', '', $result);
It gives me result 'Hello Ka. Kashish.'
Why this .(dot) is not working?
Please give me solution.
And if I can achive this word removal in any other way, pLease let me know. I want to remove only word not set of charaters, as 'Ka' word will be removed, but 'Ka' will not be removed from 'Kashish'. Please help me.
Thanks in Advance