PHP 247
September 05, 2010, 03:03:16 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 

Pages: [1]
Print
Author Topic: PHP Strip Attributes Class For XML and HTML  (Read 125 times)
TTN
Newbie
*
Posts: 1

Thank You
-Given: 0
-Receive: 0


View Profile
« on: February 06, 2010, 09:08:19 PM »

This class can clear all unwanted HTML/XML attribs.

Download:
http://semlabs.co.uk/assets/files/strip_attributes.zip

Demo:
Code:
$sa = new StripAttributes();
$sa->allow = array( 'id', 'class' );
$sa->exceptions = array(
'img' => array( 'src', 'alt' ),
'a' => array( 'href', 'title' )
);
$sa->ignore = array();
$str = $sa->strip( $str );

Source: http://semlabs.co.uk/journal/php-strip-attributes-class-for-xml-and-html
Logged
Pages: [1]
Print
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
Note, by Smoky