set('Filter.ExtractStyleBlocks', TRUE); $purifier = new HTMLPurifier($config); $level = error_reporting(E_ALL & ~E_STRICT); $html = $purifier->purify(''); error_reporting($level); list($outputcss) = $purifier->context->get('StyleBlocks'); file_put_contents($cssfile, $outputcss); echo $outputcss; } else { // Error condition - clear the cached file. file_put_contents($cssfile, ''); } } curl_close($curl);