How do I use PHP's preg_replace?

  • Thread starter Thread starter antirem
  • Start date Start date
A

antirem

Guest
I have an item called "tag" the contents of tag looks like
"puppies, cute, funny"

"," being the delimeter.

I need to chop off everything after the first comma so it would look like..
"puppies"

What is the "preg_replace" to do this?

$url-topic = preg_replace(??????);
 
Back
Top