Hi everybody,
I have a very irritating problem. It seems that I cannot get back the unserialized cookie data somehow. It totally prints nothing at this point. Could it be something's wrong in my php.ini file?
<?
if(isset($COOKIE['mycookie']))
{
$unpack = unserialize($COOKIE['mycookie']);
print_r($unpack);
print $unpack[1];
}
else
{
$expire=time()+365*86400;
$array = array
(
"test" => "foo",
"value" => "bar"
);
$serialized = serialize ($array);
setcookie ("mycookie", $serialized,$expire);
}
?>
Another question is that, I don't know why this function:
str_ireplace doesn't work on my pc either
<?php
$bodytag = str_ireplace("%body%", "black", "<body text=%BODY%>");
?>
Here is the error message I got:
Fatal error: Call to undefined function: str_ireplace() in c:\windows\desktop\y\test.php on line 2
Many thanks.