removeTags

removeTags ( string code , array listOfTags , boolean _withInnerHTML ) : string

Remove from a code, HTML tags which are in the list.

Example

removeTags("<div class=price>15€ <a href=http://site><span>More</span></a></div>",["a","span"])
 

Result : <div class=price>15€ More</div>


See also

removeOtherTagsThan
removeElement

Parameters

code

An HTML code

listOfTags

_withInnerHTML (optional)

default:false. If true, it removes all the inner content of the tag. Else it remove just the tag, not the inside content.