用POST将数组传递到另一个页面
|
如何将数组传递到另一个页面?
我的代码有什么问题?
$r=mysql_query(\"select * from pay where PayID=1\");
$ar=array();
while ($record=mysql_fetch_array($r))
{
array_push($ar,$record[\'Reserveid\']);
}
var_dump($ar);
$url = \'http://--/a.php\';
$client = curl_init($url);
curl_setopt($client, CURLOPT_POST,1);
$data = array(
\'r\' =>$ar
);
curl_setopt($client, CURLOPT_POSTFIELDS,$data);
curl_setopt ($client, CURLOPT_RETURNTRANSFER,1);
curl_setopt($client, CURLOPT_FOLLOWLOCATION, 1);
$response = curl_exec($client);
echo $response;
a.php
$r=$_POST[\'r\'];
var_dump($r);
输出是
array(3) { ...... }
-------------------------------
string(5) \"Array\"
没有找到相关结果
已邀请:
1 个回复
窃誓额
应为: