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)
);
Code: Select all
$ar = array(
'k0'=> array('a', 'b', 'c'),
'k1'=> array(1, 2, 3)
);
Code: Select all
$ar = array(
'k0'=> array('a', 'b', 'c'),
'k1'=> array(1, 2, 3)
);
header('Content-Type: application/json'); // Optional
echo json_encode($ar);