This question already has an answer here:
I have the following strings.
$string = "Welcome to Lorien.";
$search = "welcome";
Now I want to search for $search
in $string
and ignoring the case, so:
$result = str_ireplace($search, '<b>'.$search.'</b>' ,$string);
$result
should look like this: welcome to Lorien.
Is there a way i can use the case of $string
so it looks like this: Welcome to Lorien.
Like getting the part of the string which is getting replaced and use it?
</div>