我有以下代码:
if ($difference)
{
$.post("recover_functions/upload_photos.php",
{upload:$difference},
function(response)
{
alert($difference);
if (response.status)
alert("Successfully uploaded photos");
else
alert(response);
});
}
警报将显示:
{"difference":"[{\"aid\":\"100000543443572_1073741825\",\"backdated_time\":null,\"caption\":\"\",\"link\":\"http:\\\/\\\/www.facebook.com\\\/photo.php?fbid=614604095234366&set=a.614604001901042.1073741825.100000543443572&type=1\",\"pid\":\"100000543443572_2384218\",\"place_id\":null}]"}
我得到这样的`POST请求:
$string_diff = $_POST['upload'];
$array_diff = json_decode($string_diff);
echo $array_diff;
不是响应是Object of class stdClass could not be converted to string
。请帮忙,我有一个截止日期(1 小时),但我无法正常工作。