sonic656
07-20-2012, 11:11 PM
hi. I have some string:
$string = "PHP is the best!";
, then I have another string that I get from user:
$_POST['q'] = "php";.
So I found a match. Now I display $string and replace it like this
$string = str_replace($_POST['q'], "<b>".$_POST['q']."</b>", $string);.
So I want to make the searched text bold in the $string. But it works only if $_POST['q'] is "PHP" not if "php" or "Php". Is there any way to fix this?
$string = "PHP is the best!";
, then I have another string that I get from user:
$_POST['q'] = "php";.
So I found a match. Now I display $string and replace it like this
$string = str_replace($_POST['q'], "<b>".$_POST['q']."</b>", $string);.
So I want to make the searched text bold in the $string. But it works only if $_POST['q'] is "PHP" not if "php" or "Php". Is there any way to fix this?