This question already has an answer here:
Just wondering if it is possible to convert a PHP array to JSON string Heres the following PHP array:
array (
'players' => array (
'123' => '345'
'567' => '789'
),
'non_players' => array (
0 => '71558060',
1 => '14451395',
2 => '16428783',
3 => '12070702',
4 => '16872249',
5 => '10081837',
6 => '10000363',
7 => '10084478',
),
)
Is it possible to convert to JSON string?
</div>
You could just use json_encode()
, from the PHP manual: http://www.php.net/manual/en/function.json-encode.php