json_encode之后,json数据变成[{"a","1"}],怎么改成{"a","1"}
<br />function get_js_array($sql){<br /> $result = mysql_query($sql);<br /> $arr = array();<br /> while($row = mysql_fetch_array($result, MYSQL_ASSOC)){<br /> $arr[] = $row; <br /> }<br /> $js = json_encode($arr);<br /> mysql_free_result($result);<br /> mysql_close($conn);<br /> return $js;<br />}<br />