Understanding pack() and unpack()
| From: | Boget, Chris | Date: | Tue, 27 Jun 2000 15:25:30 +0000 |
| Subject: | Understanding pack() and unpack() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-3354@lists.php.net to get a copy of this message | ||
I'm trying to understand the pack() and unpack()
functions because I think they might be of some
use to me. However, I'm not able to get it to work
right. I either get an error message saying that I've
too few parameters to the pack() function or I'm
getting nothing from the unpack function. Here is
my test code:
page1.php3
<script language="php">
$getVars = pack( "h*", "group=one&user=bob&this=that" );
header( "location: page2.php3?args=$getVars" );
exit();
</script>
page2.php3
<script language="php">
echo "args: $args<br>\n";
$getVars = unpack( "h*", $args );
echo "Vars: $getVars<br>\n";
</script>
What am I doing wrong? I'm just not 'getting' the documentation... :(
Chris