PHP decode of JSON doesn't work from the Google translate API -
i'm trying decode json returned google translation service:
$r = '[[["hola mundo","hello world",,,1]],,"en"]' but when this:
echo json_decode($r); it returns me null.
i got manual maded js, trying made php
to clarify issue,
json string (and in php should quote encapsulated), in code, have not declared string array, , clear can instantiate array couple methods:
$myarray = array(); $myarray2 = []; so fix issue; encapsulate json string, replace echo json_decode($r) var_dump($r) , voila
eg
$r = '[[["hola mundo","hello world",,,1]],,"en"]'; var_dump(json_decode($r)); but not valid json syntax (check on http://jsonlint.com/)