Re: HTTP Content-length...
| From: | Hrishi | Date: | Tue, 20 Feb 2001 12:49:07 +0000 |
| Subject: | Re: HTTP Content-length... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-40735@lists.php.net to get a copy of this message | ||
> $string ="foo=bar&food=apple";
> $contentlength=$string.size;
> $uuencodestring=uuencode($string);
uuencode ? are you looking at urlencode ?
use
$contentlength=strlen($string);
also remember according to the HTTP protocol, you have to show the length of
the encoded string, not the original; which in PHP will look like :
<?
$string ="foo=bar&food=apple";
$encodedstring=urlencode($string);
$contentlength=strlen($encodedstring);
?>
other methods may or may not work if they're not HTTP compliant.
cheers,
hrishi