2013-03-05 7 views
0

아래의 json 요청을 구문 분석하여 studentName, studentemail 및 courseName과 같은 특정 값 (값)을 추출하려면 어떻게해야합니까? 요청 당 하나의 항목 만있을 것이며 나머지 값은 필요하지 않습니다. MySQL 변수에 PHP 변수를 저장해야합니다. 나는이 문제를 PHP는 객체와 배열에 당신은 json_decode 기능을 사용할 수 있습니다구문 분석 양식 PHP로 JSON 출력

 {"count":7,"data":[{"name":"Timestamp","ordinal":0,"value":"3/5/2013 2:45:31 PM"},{"name":"studentName","ordinal":1,"value":"mikejones"},{"name":"studentEmail","ordinal":2,"value":"mikejones%40gmail.com"},{"name":"courseName","ordinal":3,"value":"Grade%20Test"},{"name":"cpQuizInfoPassFail","ordinal":4,"value":"Fail"},{"name":"cpInfoPercentage","ordinal":5,"value":"75"},{"name":"institutionCode","ordinal":6,"value":"1212"}]}{"count":0}{"subject":"Course Transcript","footer":"Thank you for your participation!","footerURL":"https://sites.google.com/site/test393223837/googleformsdemotranscript/footerLogo.jpg","correctURL":"http//abc.com,"enabled":true,"correctResponseText":"Correct Response","showCorrectAnswers":true,"description":"Please keep this for your records as proof of course completion and certification.","incorrectURL":"https://sites.google.com/site/test3232393837/_/rsrc/1342229575450/googleformsdemotranscript/redX.png","fromName":"The Training Team","replyTo":"","headerURL":"https://sites.google.com/site/test3938232337/googleformsdemotranscript/CaptivateDev.jpg","isHTML":true,"title":"Course Transcript","to":"[email protected]","userResponseText":"Your Response"} 
+1

json_decode() 아니오? – Sam

+0

알고 계십니까 [json_decode] (http://php.net/manual/en/function.json-decode.php) –

+0

json_decode에 대해 알고 있습니다 만, 필요한 배열 수준을 얻는 방법을 알지 못합니다. – Darren

답변

0

, 그 구문 분석 JSON 코드 아래

참조 JSON을 겪고 곳 구문 분석이다. 자세한 내용은 설명서를 참조하십시오.