maltrecho
06-17-2005, 09:56 AM
<?php
$foo = unserialize('');
echo count($foo);
// echoes 1
print_r($foo);
// echoes nothing
?>
$foo = unserialize('');
echo count($foo);
// echoes 1
print_r($foo);
// echoes nothing
?>
|
||||
Please explain this behavior of unserializemaltrecho 06-17-2005, 09:56 AM <?php $foo = unserialize(''); echo count($foo); // echoes 1 print_r($foo); // echoes nothing ?> Kurashu 06-17-2005, 03:03 PM Unserialize is used on arrays that have been serialized. devinemke 06-17-2005, 03:07 PM from the manual on count (http://www.php.net/manual/en/function.count.php): If var is not an array or an object with implemented Countable interface, 1 will be returned. and in your example $foo will be set to boolean false, so it cannot be "counted". |
| |||
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum