2014-07-10 131 views
1

我試圖轉換或使用這樣的json_decode:JSON解碼問題翻譯的Json

{ 
"rc": 0, 
"msg": "Exitoso", 
"className": "ve.com.icg.commons.to.ActivityTransfer", 
"bean": "{\"memberEnrollmentList\":{\"enrolles\": [{\"code\":\"000400\",\"companyCode\":\"18\",\"groupCode\":\"00\",\"documentId\":\"V00000232566\",\"licenseNumber\":\"00000400\",\"name\":\"BENAIM PINTO (ZL) GONZALO\",\"dateOfBirth\":\"21-APR-27\",\"maritalStatus\":\"CAS\",\"dateOfLicenseIssuance\":\"27-JUL-95\",\"dateOfLicenseExpiration\":\"30-APR-00\",\"commercialName\":\"LA ESTIC VENEZUELA\",\"codeClient\":\"00-000400\",\"gender\":\"M\",\"activitysList\":{\"activitys\":[]}},{\"code\":\"000410\",\"companyCode\":\"18\",\"groupCode\":\"11\",\"documentId\":\"V00010289740\",\"licenseNumber\":\"11000410\",\"name\":\"COHEN DE ESTRIN NANCY\",\"dateOfBirth\":\"10-MAY-70\",\"maritalStatus\":\"CAS\",\"dateOfAdmission\":\"13-DEC-02\",\"dateOfLicenseIssuance\":\"24-SEP-10\",\"dateOfLicenseExpiration\":\"30-MAY-15\",\"codeClient\":\"11-000410\",\"gender\":\"F\",\"relationshipCode\":\"E10\",\"relationship\":\"ESPOSO (A)\",\"activitysList\":{\"activitys\":[{\"code\":\"GIMNASIO-MENSUA\",\"description\":\"GIMNASIO PLAN MENSUAL\",\"sectionsList\":{\"sections\":[{\"code\":\"MENSU\",\"openings\":0,\"description\":\"GIMNASIO PLAN MENSUAL\"}]}}]}},{\"code\":\"000410\",\"companyCode\":\"18\",\"groupCode\":\"00\",\"documentId\":\"V00000960057\",\"licenseNumber\":\"00000410\",\"name\":\"ABADI DE BENAIM JUDITH\",\"dateOfBirth\":\"23-MAY-32\",\"maritalStatus\":\"VIU\",\"dateOfLicenseIssuance\":\"29-FEB-08\",\"dateOfLicenseExpiration\":\"30-MAY-13\",\"codeClient\":\"00-000410\",\"gender\":\"F\",\"relationshipCode\":\"E10\",\"relationship\":\"ESPOSO (A)\",\"activitysList\":{\"activitys\":[{\"code\":\"EVENADUL-ENSATU\",\"description\":\"ENSALADAS PARA TU BISHVAT \\\"MARISOL BENDAYAN\\\" (07/02/2012)\",\"sectionsList\":{\"sections\":[{\"code\":\"1\",\"openings\":0,\"description\":\"ENSALADAS PARA TU BISHVAT\"}]}}]}},{\"code\":\"000412\",\"companyCode\":\"18\",\"groupCode\":\"11\",\"documentId\":\"E00000786622\",\"licenseNumber\":\"11000412\",\"name\":\"SHIRLEY DOUEK DE COHEN\",\"dateOfBirth\":\"17-NOV-38\",\"maritalStatus\":\"CAS\",\"dateOfAdmission\":\"12-DEC-02\",\"dateOfLicenseIssuance\":\"29-JUL-07\",\"dateOfLicenseExpiration\":\"30-NOV-12\",\"codeClient\":\"11-000412\",\"gender\":\"F\",\"relationshipCode\":\"S12\",\"relationship\":\"SUEGRA\",\"activitysList\":{\"activitys\":[{\"code\":\"DEPORTES-GIMNAS\",\"description\":\"GIMNASIA ARTISTICA ESCUELAS DEPORTIVAS Y DEPORTE FEDERADO\",\"sectionsList\":{\"sections\":[{\"code\":\"GIMN10\",\"openings\":0,\"description\":\"MEJJORAMIENTO FISICO 4\"}]}}]}},{\"code\":\"000420\",\"companyCode\":\"18\",\"groupCode\":\"11\",\"licenseNumber\":\"11000420\",\"name\":\"ESTRIN COHEN SHARON\",\"dateOfBirth\":\"29-SEP-98\",\"maritalStatus\":\"SIN\",\"codeClient\":\"11-000420\",\"gender\":\"F\",\"relationshipCode\":\"H01\",\"relationship\":\"HIJO 1\",\"activitysList\":{\"activitys\":[]}},{\"code\":\"000430\",\"companyCode\":\"18\",\"groupCode\":\"11\",\"licenseNumber\":\"11000430\",\"name\":\"ESTRIN COHEN SHIRLEY\",\"dateOfBirth\":\"02-SEP-99\",\"maritalStatus\":\"SIN\",\"codeClient\":\"11-000430\",\"gender\":\"F\",\"relationshipCode\":\"H02\",\"relationship\":\"HIJO 2\",\"activitysList\":{\"activitys\":[{\"code\":\"BAILES-BADULT\",\"description\":\"BAILES ISRAELIES ADOLESCENTES\",\"sectionsList\":{\"sections\":[{\"code\":\"02\",\"openings\":0,\"description\":\"SEGUNDO AÑO\"}]}},{\"code\":\"DEPORTES-GIMNAS\",\"description\":\"GIMNASIA ARTISTICA ESCUELAS DEPORTIVAS Y DEPORTE FEDERADO\",\"sectionsList\":{\"sections\":[{\"code\":\"GIMN10\",\"openings\":0,\"description\":\"MEJJORAMIENTO FISICO 4\"}]}}]}}]}}", 
"accessLog": { 
    "sessionId": "0cd4ceec6d753af545d3bfc0939a0759", 
    "userName": "DGAMBOA", 
    "RC": 0 
}, 
"token": "0cd4ceec6d753af545d3bfc0939a0759" 
} 

但響應其空,我怎麼解決這個問題?

我存儲此JSON的txt文件,並呼籲..

$textJson= file_get_contents('JSON2.txt'); 
$arrJson = json_decode($textJson,true); 
+0

我想你應該通過編碼字符串到json_decode方法的JSON,並且您的代碼似乎沒有正確編碼 – Carlos487

+0

我同意@ Carlos487。另外,如果你有更多的問題,通常添加'true'就會訣竅:'json_decode($ json,true)'; – user1947561

+0

我認爲,但我去了頁面http://jsonlint.com/,並檢查它,JSON的罰款。 – CarlosZ

回答

1

這條線是你的問題:

\"description\":\"ENSALADAS PARA TU BISHVAT \\\"MARISOL BENDAYAN\\\" (07/02/2012)\" 
+0

對不起,我查過了,沒有任何信息 – CarlosZ

+0

您是正確的先生,變化'\\\「MARISOL BENDAYAN \\」對'\「MARISOL BENDAYAN \」或\\\\\\\「MARISOL BENDAYAN \\\\\」'',它的工作方式與@Yoshi示例中的評論 – superphonic

+0

我解決了,錯誤是在「Ñ」字符,我已經替換和工作,你建議我在 – CarlosZ