2

I'm trying to send an array to another page, such that when I get the array on the next page, only the array shows up and not the values. I then want to extract the values individually. I'm using the following code below. While this code works, on the redirect page, it returns 0=555928038&1=1694191&2=359564591&3=33280807&4=918458113 in the url. I don't want to see these values in the url. I want to see just the array and then I want to extract the values. What can I do to change this header redirect?

header('Location: twittercurlusershow.php?' . http_build_query($arrayoffollowers));
4

2 回答 2

4

将数组与唯一标识符一起存储在其他地方(数据库、文件系统、会话)。将标识符附加到 URL。在目标页面上,从标识符恢复数组。

或者,对数组进行序列化和 base64 编码,将其作为请求变量添加到 url,然后在目标页面上,对其进行 base64 解码和反序列化。这仅适用于小型数组,因为浏览器可以处理的 URL 的最大长度可能低至 2083 字节。

于 2013-07-22T04:10:50.853 回答
1

您可以使用 $_SESSION 变量将数组存储在原始页面上,然后从 twittercurlusershow.php 调用它。

这是使用 $_SESSION 的教程。

于 2013-07-22T04:17:42.507 回答