note 87431 added to function.fsockopen
| From: | KaiSellgren at osu1 dot php dot net | Date: | Thu, 04 Dec 2008 22:27:16 +0000 |
| Subject: | note 87431 added to function.fsockopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-147651@lists.php.net to get a copy of this message | ||
Here's a function to decode transfer chunked encoded string. Note: this works only for the
body, don't try to use this for head+body, first explode the body and head
explode("\r\n\r\n",$bodyhead,2);
<?php
function transfer_encoding_chunked_decode($encoded)
{
$decoded = '';
while (!empty($encoded))
{
$explode = explode("\r\n",$encoded,2);
$counter = hexdec($explode[0]);
$decoded .= substr($explode[1],0,$counter);
$encoded = substr($explode[1],$counter,strlen($explode[1])-$counter);
}
return $decoded;
}
?>
----
Server IP: 80.81.171.181
Probable Submitter: 81.175.154.102
----
Manual Page -- http://www.php.net/manual/en/function.fsockopen.php
Edit -- https://master.php.net/note/edit/87431
Del: integrated -- https://master.php.net/note/delete/87431/integrated
Del: useless -- https://master.php.net/note/delete/87431/useless
Del: bad code -- https://master.php.net/note/delete/87431/bad+code
Del: spam -- https://master.php.net/note/delete/87431/spam
Del: non-english -- https://master.php.net/note/delete/87431/non-english
Del: in docs -- https://master.php.net/note/delete/87431/in+docs
Del: other reasons-- https://master.php.net/note/delete/87431
Reject -- https://master.php.net/note/reject/87431
Search -- https://master.php.net/manage/user-notes.php