Filter a string for words that starts with a "?" and put them in a <span> - PHP -


what wanna filter string one:

"?group title" 

and output this:

<span class="group">group</span> title 

my question offcourse is: possible php? , how this?

try this

$text = preg_replace('/\?(\w+)/', '<span class="$1">$1</span>', $text); 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -