php数组的格式输出有关问题,请问大神

WBOY
Release: 2016-06-13 12:26:46
Original
804 people have browsed it

php数组的格式输出问题,请教大神
我有以下这样一个表


请问,我要怎样才能让他根据 type类型和typeid来输出下面这个数组格式?谢谢

<br />Array(  <br />[0] => array(<br />            [0]=><br />            [1]=>婚庆服务<br />            [2]=>机械设备<br />            [3]=>医院医疗<br />            [4]=>照明灯饰<br />            [5]=>教育培训<br />            [6]=>化工涂料<br />            [7]=>美容健身<br />            [8]=>餐饮美食<br />            [9]=>汽车服务<br />            )<br />[1] => array(<br />            [0]=><br />            [1]=>常规<br />            [2]=>两列<br />            [3]=>三列<br />            [4]=>网格<br />            )<br />)<br />
Copy after login


------解决思路----------------------
查询后读取
while($row = mysql_fetch_assoc($rs)) {<br />  $res[$row['type'][] = $row['typevalue'];<br />}<br />$res = array_values($row);
Copy after login

------解决思路----------------------
我的错!
$res = array_values($res);

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template