标签:
$arr
=
array
();
$rs
= mysql_query(
"select * from `table`"
);
while
(
$row
= mysql_fetch_array(
$rs
)){
$arr
[] =
$row
;
}
//现在数组就是二维数组了 想输出json 的话就
echo
json_encode(
$arr
);
PHP从mysql中取出多组数据 如何加入数组中并转成JSON数
标签:
原文地址:http://www.cnblogs.com/xiaofeng028/p/4174900.html