Ask a question about PHP array format again, please.
Thanks for the problem with the previous array xuzuning help me answer, I want to ask another, if I put the table type value in the array this can also do?
The following array is implemented through the table above
Array (
[classname] = = Array (
[0]=>
[1]=> Wedding Service
[2]=> Machinery and equipment
[3]=> Hospital Medical
[4]=> Lighting Fixtures
[5]=> Education and Training
[6]=> Chemical Coating
[7]=> Beauty and Fitness
[8]=> Gourmet Dining
[9]=> Car Service
)
[Layout] = = Array (
[0]=>
[1]=> General
[2]=> two columns
[3]=> three columns
[4]=> Grid
)
)
------to solve the idea----------------------
According to my writing, $res is the format you want now.
Because your post wants an array of subscripts, there will be
$res = Array_values ($res);
------to solve the idea----------------------
while ($row = Mysql_fetch_assoc ($rs)) {
if ($row [' typeid '] = = 0) $row [' typevalue '] = ';
$res [$row [' type ']][] = $row [' Typevalue '];
}