note 107020 modified in function.fsockopen by danbrown

From: Date: Tue, 03 Jan 2012 21:53:05 +0000
Subject: note 107020 modified in function.fsockopen by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-185302@lists.php.net to get a copy of this message
My recursive unchunk function: <?php function unchunk($result) {return preg_replace('/([0-9A-F]+)\r\n(.*)/sie', '($cnt=@base_convert("\1", 16, 10)) ?substr(($str=@strtr(\'\2\', array(\'\"\'=>\'"\', \'\\\\0\'=>"\x00"))), 0, $cnt).unchunk(substr($str, $cnt+2)) :"" ', $result ); } ?> --was-- (Corrected)My recursive unchunk function: <?php function unchunk($result) {return preg_replace('/([0-9A-F]+)\r\n(.*)/sie', '($cnt=@base_convert("\1", 16, 10)) ?substr(($str=@strtr(\'\2\', array(\'\"\'=>\'"\', \'\\\\0\'=>"\x00"))), 0, $cnt).unchunk(substr($str, $cnt+2)) :"" ', $result ); } ?> http://php.net/manual/en/function.fsockopen.php

« previous php.notes (#185302) next »