23/02/2011

I found some good word cleaner Wordoff.com and near it (in comments) found this alternative in php:

function stripAttributes($string)
{
$string=preg_replace(’/()/’, ‘${1}href..;,;..${2}’, $string);
$string=preg_replace(’/()/’, ‘${1}id..;,;..${2}’, $string);
$string=preg_replace(’/()/’, ‘${1}class..;,;..${2}’, $string);
while(preg_match(’/()/’, $string)) $string=preg_replace(’/()/’, ‘${1}${4}’, $string);
$string=str_replace(’..;,;..’, ‘=’, $string);
return $string;
}

in some days ill test it

No comments:

Post a Comment