$out = array( "x" => 1, "ig" => 234, ); echo json_encode( $out );
$.ajax({ url: "ajax.php", data: { n: 1 }, type: "post", dataType: "json", success: function( data, textStatus, xhr ) { alert( data.x ); alert( data.ig ); } });