RE: [PHP] Serialize/Unserialize
| From: | Robert Collins | Date: | Tue, 14 Nov 2000 18:41:49 +0000 |
| Subject: | RE: [PHP] Serialize/Unserialize | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-25220@lists.php.net to get a copy of this message | ||
Based on your earlier messages why dont you try this. added benefit is the
data is encoded which if I understand correctly is what you wanted anyway.
<?
$host_key = array( "$HOSTNAME" );
$host_key = base64_encode( serialize( $host_key ));
$host_name = unserialize( base64_decode( $host_key ));
?>
Robert W. Collins
Web Developer II
Insight / TC Computers
www.insight.com
www.tccomputers.com
-----Original Message-----
From: Boget, Chris [mailto:Chris.Boget@wild.net]
Sent: Tuesday, November 14, 2000 10:56 AM
To: PHP (E-mail)
Subject: [PHP] Serialize/Unserialize
My brain must be mush today. Something this simple
I just cannot figure out and I'm beating my head against
the wall (under a time crunch no less).
Why isn't this working?
$host_key = array( "$HOSTNAME" );
$host_key = urlencode( serialize( $host_key ));
echo "HostKey: $host_key<br><br>\n";
$host_name = urldecode( unserialize( $host_key ));
$host_key has a value but after processing, $host_name is coming
up blank...
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net