I have created an php script in order to read data send from an android app to php and save it in file but upon opening the text file i'm getting following statement :-
ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray
instead of data could somebody tell me where iam going wrong and how can i rectify it ?
Here is my php script :-
<?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);
}
?>