loadHTML( $_content ); $dom = $doc->documentElement->firstChild; $domRm = array( ); foreach( $dom->childNodes as $ch ) { if( !in_array( $ch->nodeName, $_arr ) ) { $domRm[] = $ch; } } foreach( $domRm as $el ) { $el->parentNode->removeChild( $el ); } $rett = $doc->saveHTML( ); $rett = substr( $rett, strpos( $rett, "" ) + 12 ); $rett = substr( $rett, 0, strpos( $rett, "" ) ); return $rett; } function colorFamily( $hex , $lum = 0 ){ // validate hex string if( $hex[ 0 ] == '#' ){ $hex = substr( $hex , 1 ); } if( strlen( $hex ) < 6 ){ $hex = $hex[ 0 ] . $hex[ 0 ] . $hex[ 1 ] . $hex[ 1 ] . $hex[ 2 ] . $hex[ 2 ]; } // convert to decimal and change luminosity $rgb = "#"; $c = 0; for ( $i = 0; $i < 3; $i++) { $c = hexdec( substr( $hex , $i*2 , 2 ) ); $c = dechex( round( min( max( 0, $c + ( $c * $lum ) ) , 255 ) ) ); $rgb .= substr ( "00" . $c , strlen( $c ) ); } return $rgb; } /// //////////////////////////////////////////////////////////////////////////// class lib { function call( ) { echo "do something"; } }; ?>