note 80268 rejected from function.pack by nlopess
| From: | nlopess@php.net | Date: | Mon, 07 Jan 2008 14:12:06 +0000 |
| Subject: | note 80268 rejected from function.pack by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134919@lists.php.net to get a copy of this message | ||
Note Submitter: ron656 at gmail dot com
----
I was playing around with pack function.
[code]
$dom = "Ursa-Minor";
$dom_len = strlen($dom); //10
$dom_len_hex = pack("s",$dom_len); //0A00
print $dom_len_hex;
[/code]
Expected this to give 0A 00 but ended up with 0D 0A 00
There is a CR ^M in front of the result.
Did the same with $dom = "Ursaa-Minor" and $dom = "Urs-Minor". Which gave me the
expeced result 0B 00 and 09 00
Can someone explain why 0A 00 is orefixed with 0D (CR ^M)
greetz,
Ron