php - How to color specific word inside paragraph tag? -


i trying color specific word inside paragraph. there way make happen?

this trying achieve:

enter image description here

say in <p>hello world</p>, want color word "world" inside paragraph.

is there way it?

to make things clear here want achieve:

enter image description here

$paragraph = "hello world"; $paragraph = str_replace('world', '<span class="highlightclass">world</span>', $paragraph); echo '<p>'.$paragraph.'</p>'; 

css

.highlightclass{ color:green; } 

Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -