Jump to content


Photo

Unserialize ??


  • Please log in to reply
1 reply to this topic

#1 $cripts

$cripts
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 06 March 2006 - 09:24 PM

im having quite a problem with unserialize function....
heres the example
session_start();
$array = $_COOKIE['cookie'];
echo $array;
$cookie = unserialize($array);
if(!$cookie) {
 echo "Unserialize??";
 }
echo $cookie[21];

when i echo $array it shows a:1:{i:21;s:5:\"Hello\";} as it should....but when i unserialize the array it doesnt work?? any hepl here thmx

**PROBLEM FIXED**

quess u cannot have quotes inside a serialized array?

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 06 March 2006 - 09:39 PM

No, you can't have [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]escaped[!--colorc--][/span][!--/colorc--] quotes in a serialized array. If you had done a
<?php $cookie = stripslashes(unserialize($array)); ?>
it would have worked.

Ken




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users