Jump to content

Removing text from a php variable


damanman

Recommended Posts

In the case you can just use strip_tags(), but more generally regular expressions would be used for this type of manipulation.

Link to comment
Share on other sites

Hah. Forgot about strip_tags. I was going to suggest this:

$myElement = '<span id="sobi2Details_field_street">www.google.com</span>';$doc = new DOMDocument();$doc->loadHTML($myElement);echo $doc->textContent;

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...