我有這個字符串:解析JSON在PHP「stdClass的不能轉換爲字符串」錯誤
{\"lat\":37.790388261934424,\"lng\":-122.46047996826172},{\"lat\":37.789608231530124,\"lng\":-122.46344112701416}
然後感謝StackOverflowers的幫助下,我這樣做是爲了剝奪斜線:
$markers = stripslashes($markers);
然後我嘗試添加這似乎對由解碼功能
$markers = json_decode('['.$markers.']');
是需要外部支架正確的方式去呢?然後我試圖做到這一點:
foreach($markers as $key => $value)
{
$some_string = $some_string.' ('.$value.') ';
}
哪款遊戲我這個錯誤:
Object of class stdClass could not be converted to string
但我真正需要的是緯度/經度值提取到$緯度,$ LNG變量。有人可以告訴我如何解決我得到的錯誤,並將值放入變量中?
謝謝, 亞歷克斯
這真的沒有解決的問題比任何其他的答案做的更好。 – 2012-09-23 20:05:10
什麼是php json解析的javascript代碼? – endyourif 2012-09-24 01:57:11