I don't want to create a shortcut search function via php
when I search for a part of a word ... the whole word will be colored
for example, this is an example of text:
Text: UK regulators say traders used private online chats to coordinate their purchases and sales in order to change currency prices in their favor.
when I search for "th", the result will be like this:
Text: UK regulators say traders used private online chats to coordinate their buying and selling, to change the currency prices in them .
So ... I tried this code ... please help me fill it out.
This is the algorithm:
$text= "British regulators say...";
foreach($word in $text)
{
if( IS There "th" in $word)
{
$word2= '<b>'.$word.'</b>'
replace($word with word2 and save in $text)
}
}
how can i do this in php language?