我工作的情緒API,它使輸出JSON格式 現在我想解析它在PHP解析JSON格式輸出
{ "status": "OK", "usage": "By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use: http://www.alchemyapi.com/company/terms.html", "url": "", "language": "english", "docSentiment": { "type": "neutral" } }
這是我的輸出JSON格式。
我想輸出只是"type" = "neutral"
的例子只是使用'json_decode'! '$ decode = json_decode($ jsonString,true); echo $ decode ['docSentiment'] ['type'];'[check here](http://codepad.org/UnbsM1HJ) –
Json格式需要':'不是'=' – Bora
這個問題已被多次詢問並且在互聯網上很容易找到。你顯然沒有做任何事情找到一個解決方案之前發佈它在這裏... – NDM