note 96183 added to function.fsockopen

From: Date: Fri, 12 Feb 2010 18:23:51 +0000
Subject: note 96183 added to function.fsockopen
Groups: php.notes 
Request: Send a blank email to php-notes+get-165917@lists.php.net to get a copy of this message
A short, quick unchunk function that makes use of regular expressions: <?php function unchunk($result) { return preg_replace_callback( '/(?:(?:\r\n|\n)|^)([0-9A-F]+)(?:\r\n|\n){1,2}(.*?)'. '((?:\r\n|\n)(?:[0-9A-F]+(?:\r\n|\n))|$)/si', create_function( '$matches', 'return hexdec($matches[1]) == strlen($matches[2]) ? $matches[2] : $matches[0];' ), $result ); } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 24.234.114.199 ---- Manual Page -- http://www.php.net/manual/en/function.fsockopen.php Edit -- https://master.php.net/note/edit/96183 Del: integrated -- https://master.php.net/note/delete/96183/integrated Del: useless -- https://master.php.net/note/delete/96183/useless Del: bad code -- https://master.php.net/note/delete/96183/bad+code Del: spam -- https://master.php.net/note/delete/96183/spam Del: non-english -- https://master.php.net/note/delete/96183/non-english Del: in docs -- https://master.php.net/note/delete/96183/in+docs Del: other reasons-- https://master.php.net/note/delete/96183 Reject -- https://master.php.net/note/reject/96183 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#165917) next »