note 77387 added to function.serialize
| From: | euromark at web dot de | Date: | Mon, 27 Aug 2007 21:30:42 +0000 |
| Subject: | note 77387 added to function.serialize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129839@lists.php.net to get a copy of this message | ||
Funny thing...
I serialized an array $thenumbers[] with 5-6 item in it.
$numbers=serialize($thenumbers);
$_SESSION['admin_numbers']=$numbers;
But when i unserialized them, the count() function does only return a correct number, if the array
got at least 1 item.
$findarray= unserialize($_SESSION['admin_numbers']);
echo count($findarray);
so if the session variable is empty, it will still return 1 instead of 0...
what can i do? its kinda important because this way i wanted to check, if the session has some
values in it - to use them in on the page
thank you
----
Server IP: 217.160.72.57
Probable Submitter: 77.176.204.16
----
Manual Page -- http://www.php.net/manual/en/function.serialize.php
Edit -- https://master.php.net/note/edit/77387
Del: integrated -- https://master.php.net/note/delete/77387/integrated
Del: useless -- https://master.php.net/note/delete/77387/useless
Del: bad code -- https://master.php.net/note/delete/77387/bad+code
Del: spam -- https://master.php.net/note/delete/77387/spam
Del: non-english -- https://master.php.net/note/delete/77387/non-english
Del: in docs -- https://master.php.net/note/delete/77387/in+docs
Del: other reasons-- https://master.php.net/note/delete/77387
Reject -- https://master.php.net/note/reject/77387
Search -- https://master.php.net/manage/user-notes.php