我在读取数据的顺序创建的PHP脚本从Android应用PHP发送并保存在文件中,但在打开文本文件,我得到下面的语句: -PHP脚本返回数组数组?
ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray
而不是数据有人可以告诉我哪里出错了,我该如何纠正它?
这里是我的PHP脚本: -
<?php
$password="";
$user="root";
$database="shadowpets";
$host="localhost";
$response=array();
$con=mysqli_connect($host,$user,$password,$database)or die("Unable to connect");
if($_SERVER["REQUEST_METHOD"]=="POST")
{
if(isset($_POST['OrderSummary']))
{
$data=$_POST['OrderSummary'];
$json=json_decode($data,true);
$file='text.txt';
$result=file_put_contents($file,$json);
$response["success"]=1;
$response["message"]="done";
}
else
{
$response["success"]=0;
$response["message"]="parameters not correctl formatted";
}
echo json_encode($response);
}
?>
脚本中包含什么内容?你如何呈现数据? – hungrykoala
请显示您的代码 – KRIPS
如果我们不知道您的代码,我们应该如何知道您做错了什么?请阅读[问]。 –