You are here:  » Remove HTML


Remove HTML

Submitted by dan76 on Fri, 2014-09-05 20:12 in

I'm importing records from an old Yahoo Store objinfo.xml file, and the contents of one of the fields has a lot of html that I want to cleanup during imports. This is what one of the sample import field looks like:

<!--NOSEARCH--><p><font size="2" face="Arial"><b>Product name here in bold</b>is a&nbsp; sample product from a </font> </p> <p> <font size="2" face="Arial">Trademarked® brand that gets results™. Visit <a href="http://www.mywebsite.com">our website</a>.</font><font size="2" face="Arial"> <ul> <li>bullet one </li> <li>bullet two</li></ul>

I'd like it to import like this instead:

Product name here in bold is a sample product from a Trademarked brand that gets results. Visit our website. bullet one bullet two

Is there a way to do this easily?

Submitted by support on Fri, 2014-09-12 19:53

Hello Dan,

For sure - at the point at which you use the field by using, for example:

$record["DESCRIPTION"]

...simply enclose that in PHP's strip_tags() function, e.g.

strip_tags($record["DESCRIPTION"])

Hope this helps!
Cheers,
David
--
MagicParser.com