Returning JSON from a PHP Script
Posted: 24 Nov 2014, 13:25
Hi
I have this array, and I want to return it as JSON from a PHP script.
Do I just echo the result? Do I have to set header content-types?
I have this array, and I want to return it as JSON from a PHP script.
Code: Select all
$ar = array(
'k0'=> array('a', 'b', 'c'),
'k1'=> array(1, 2, 3)
);