How to style specific words from a given string ?
$myString = "foo bar";
How to make a function that bold a given word if it is found on the string, than return the string again
$formattedString = Bold('foo',$myString);
echo $formattedString ;
Expected result :
foo bar
How can i do this ? I need to bold some keyword / phrases in the search resut based on typed user query
Any help would be appreciated
Do you mean like: