0
我正在尋找在對象之前刪除字符串和冒號符號,以便我可以搜索對象的實體。如何在PHP中的對象之前刪除字符串和冒號?
例如,我有:
{ "result": [ { "face_id": "b668c61ad349ea928c75ba46338008af", "landmark": { "contour_chin": { "x": 55.448237, "y": 35.152167 }, "contour_left1": { "x": 40.641011, "y": 26.241833 }, "contour_left2": { "x": 40.791324, "y": 27.7615 }
,我想有:
{55.448237, 35.15216},{40.641011,26.241833 },{40.791324,27.7615 }
如果沒有簡單的方法來去除串,你能推薦一個簡單的方法來搜索相應的數字。所以..我搜索「contour_left2」並返回{40.791324,27.7615}。
謝謝。
你有什麼是一個json字符串,使用'json_decode($ jsonString)'將它轉換成一個數組或對象數組。 – JimL
[用PHP解析JSON文件]可能的重複(http://stackoverflow.com/questions/4343596/parsing-json-file-with-php) – radoh