mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FEATURE: Ticket #2408 - Merged patch to Convert::array2json() which makes uses of the PHP function json_encode when available
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@53182 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
081905485f
commit
6c342f7db5
@ -143,6 +143,9 @@ class Convert extends Object {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static function array2json( $array ) {
|
static function array2json( $array ) {
|
||||||
|
if(function_exists("json_encode")) {
|
||||||
|
return json_encode($array);
|
||||||
|
}
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
||||||
// Debug::show($array);
|
// Debug::show($array);
|
||||||
|
Loading…
Reference in New Issue
Block a user