一個HTTP POST在C#中的PHP之後我在代碼中獲取形式 的輸出,我有腓解序列化一個序列化JSON字符串
public function actionSubmitInspection(){
$data = $_POST;
return (array)$data["check_comments"];
}
現在正在逐漸形式的結果
[
"[{\"id\":26,\"comment\":\"89oiu\"},{\"id\":27,\"comment\":\"comment 2\"}]"
]
從我嘗試類型轉換數組不創建數組,我怎樣才能將序列化的字符串轉換爲數組或對象。
http://php.net/manual/en/function.json-decode.php –
你試過'json_decode($ result [0]);'? –