$x = array('xxx'=> array('ttt' => 3, 'kkk' => 4 ), 'yyy' => 123); echo '<pre>' . print_r($x, true) . '</pre>'; $s = json_encode($x); echo $s; echo '<pre>' . print_r(json_decode($s, true), true) . '</pre>';