From: "Hrishi" <[EMAIL PROTECTED]>

> > $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
>



Note that you should not urlencode() the string after it's already
URL-formatted.


$string ="foo=bar&food=apple";
$encodedstring=urlencode($string);

echo $encodedstring;
// Will output: foo%3Dbar%26food%3Dapple


If "bar" and "apple" were variables, you would rather urlencode() them
individually.


Cheers

Simon Garner


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to