mardi 23 août 2016

Ignore empty match php Regex

I need to replace all of the text within the tag (which is not a code). So I'm using:

preg_replace('/<.*?>([^<]*)</.*?>/', "new_text", $str)

And I get a result. But I need to remove all empty and onlywhitespace matches or eliminate them from the search. How can i do it?

Aucun commentaire:

Enregistrer un commentaire