数组传递这么写:   echo "<a href=2.php?info=".base64_encode(serialize($information))." >info</a>" ;

数组接收 : $info = unserialize(base64_decode($_GET['info']));

访问的话: echo $info['name'];

注意unserialize和base64_decode的顺序。

还有一点注意:最好不要用urlencode和urldecode,urldecode会将'+'这个字符转换成空格。

发送页:

$information = array('name' => 'fin+ly')

echo "<a href=2.php?info=".urlencode(serialize($information))." >info</a>" ;

接收页:$info = unserialize(urldecode($_GET['info']));

echo $info['name'],结果是"fin ly"。这样就不对了。

相关文章:

  • 2021-09-07
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2022-03-15
  • 2021-09-08
猜你喜欢
  • 2021-08-04
  • 2022-12-23
  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2021-09-18
相关资源
相似解决方案