Bug #19285 » 9286_json.diff
t3lib/class.t3lib_div.php (working copy) | ||
---|---|---|
return $str;
|
||
}
|
||
/**
|
||
/**
|
||
* Creates recursively a JSON literal from a mulidimensional associative array.
|
||
* Uses Services_JSON (http://mike.teczno.com/JSON/doc/)
|
||
* Uses native function of PHP >= 5.2.0
|
||
*
|
||
* @param array $jsonArray: The array to be transformed to JSON
|
||
* @return string JSON string
|
||
*/
|
||
public static function array2json(array $jsonArray) {
|
||
if (!$GLOBALS['JSON']) {
|
||
require_once(PATH_typo3.'contrib/json/json.php');
|
||
$GLOBALS['JSON'] = t3lib_div::makeInstance('Services_JSON');
|
||
}
|
||
return $GLOBALS['JSON']->encode($jsonArray);
|
||
return json_encode($jsonArray);
|
||
}
|
||
/**
|