PHP json_decode JSON string not decoding -
{ "hintsacross": [ { "number":"1" , "hinttext":"hurt", "hintsquare":"a1" }, { "number":"5" , "hinttext":"make selection", "hintsquare":"a6" }, { "number":"8" , "hinttext":"frank", "hintsquare":"a10" } ] , "hintsdown": [ { "number":"1" , "hinttext":"first greek letter", "hintsquare":"a1" }, { "number":"2" , "hinttext":"used footnotes", "hintsquare":"a2" }, { "number":"3" , "hinttext":"listened to", "hintsquare":"a3" } ] }
for reason json_decode of php not decoding json.
thanks in advance...
p.s. getting error when line 25 runs:
$temp = json_decode( $obj->hints,true );
parse error: syntax error, unexpected 'hintsacross' (t_string) in c:\program files (x86)\zend\apache2\htdocs\crosswords\query.blockouts.php on line 25
i validated json through jsonlint , parse error coming out.
it invalid json. try adding comma before "hintsdown" , retrying json_decode.
{ "hintsacross": [ { "number": "1", "hinttext": "hurt", "hintsquare": "a1" }, { "number": "5", "hinttext": "make selection", "hintsquare": "a6" }, { "number": "8", "hinttext": "frank", "hintsquare": "a10" } ], "hintsdown": [ { "number": "1", "hinttext": "first greek letter", "hintsquare": "a1" }, { "number": "2", "hinttext": "used footnotes", "hintsquare": "a2" }, { "number": "3", "hinttext": "listened to", "hintsquare": "a3" } ] }
Comments
Post a Comment