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

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -