underline text in a string

this is how to underline text in a string

<?php
$text = <<<EOD
This is some sample text, we want to make programmershelp appear in bold
EOD;
//before
echo $text;

$word = 'programmershelp';
//after
echo str_replace($word, '<u>' . $word . '</u>', $text);
?>