note 104581 deleted from function.ob-start by danbrown

From: Date: Fri, 24 Jun 2011 15:30:41 +0000
Subject: note 104581 deleted from function.ob-start by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-180925@lists.php.net to get a copy of this message
Note Submitter: admin at ajaxel dot com ---- I have this function with ob_handler used in Ajaxel CMS: <?php public static function parse($html) { return substr(preg_replace('~(.*)(<textarea.*<\/textarea>)~Usie', "OB::friendly('$1',true) .str_replace('\\\"','\"','$2')", $html .'<textarea></textarea>'),0,-21); } public static function friendly ($html, $preg = false) { if ($preg) $html = str_replace('\"','"',$html); $html = str_replace('&amp;','[[:AMP:]]',$html); if (HTTP_EXT) $html = str_replace(' href="/"',' href="/?'.URL_KEY_HOME.'"',$html); $html = preg_replace('~(\shref="|\saction="|location\.href=\')(\?|\/\?)([^;]*)(\'\+\$\(|"|\')~Uie', "self::_friendly('?$3','$1','$4')",$html); self::images($html); $html = str_replace('[[:AMP:]]','&amp;',$html); return $html; } private static function _friendly($url,$start,$end) { return str_replace('\"','"',$start). URL::HT($url).str_replace('\"','"',$end); } ?> if u understand this, u're the good programmer :) stupid PHP.net with their wordwrap shit

« previous php.notes (#180925) next »