我已经用一个带空格的值设置了我的饼干name
。我已经检查了浏览器中的cookie值是否John+Steve
。然而,通过网站回声,它只显示John
,+
后忽略值。
<?php
setcookie('name','John Steve');
?>
<?php
if(isset($_COOKIE['name'])){
echo $_COOKIE['name'];
}
?>
我尝试用
echo rawurldecode($_COOKIE['name']);
它仍然显示相同的结果。请帮我解决这个问题,并用John Steve
来回应它。谢谢!!!
尝试如下 echo urldecode($_COOKIE['name']);