php - How to color specific word inside paragraph tag? -
i trying color specific word inside paragraph. there way make happen?
this trying achieve:

say in <p>hello world</p>, want color word "world" inside paragraph.
is there way it?
to make things clear here want achieve:

$paragraph = "hello world"; $paragraph = str_replace('world', '<span class="highlightclass">world</span>', $paragraph); echo '<p>'.$paragraph.'</p>'; css
.highlightclass{ color:green; }
Comments
Post a Comment