Last Minder
10-07-2008, 08:51 PM
First of all, thanks for everyone willing to helps me out~!
$test = array();
$test[0] = array
(
[id] => 0001
[content] => array
(
[clipA_exsiting] => "yes"
[clipB_exsiting] => "no"
[clipC_exsiting] => "yes"
)
}
$test[1] = array
(
[id] => 0002
[content] => array
(
[clipA_exsiting] => "no"
[clipB_exsiting] => "yes"
[clipC_exsiting] => "yes"
)
}
$test[2] = array
(
[id] => 0003
[content] => array
(
[clipA_exsiting] => "yes"
[clipB_exsiting] => "no"
[clipC_exsiting] => "no"
)
}
// Need Help for sorting the array and print out here
I am looking to get this out put:
if user choose sort content by ClipA:
id ......... ClipA ......... ClipB ......... ClipC
0001 ......... yes ......... no ......... yes
0003 ......... yes ......... no ......... no
0002 ......... no ......... yes ......... yes
if user choose sort content by ClipB:
id ......... ClipA ......... ClipB ......... ClipC
0002 ......... no ......... yes ......... yes
0001 ......... yes ......... no ......... yes
0003 ......... yes ......... no ......... no
if user choose sort content by ClipC:
id ......... ClipA ......... ClipB ......... ClipC
0001 ......... yes ......... no ......... yes
0002 ......... no ......... yes ......... yes
0003 ......... yes ......... no ......... no
Therefore, basicly I just want to sort this array $test by the sub-array $test[x][$content] base on user selection.
Am I make myself clear?
$test = array();
$test[0] = array
(
[id] => 0001
[content] => array
(
[clipA_exsiting] => "yes"
[clipB_exsiting] => "no"
[clipC_exsiting] => "yes"
)
}
$test[1] = array
(
[id] => 0002
[content] => array
(
[clipA_exsiting] => "no"
[clipB_exsiting] => "yes"
[clipC_exsiting] => "yes"
)
}
$test[2] = array
(
[id] => 0003
[content] => array
(
[clipA_exsiting] => "yes"
[clipB_exsiting] => "no"
[clipC_exsiting] => "no"
)
}
// Need Help for sorting the array and print out here
I am looking to get this out put:
if user choose sort content by ClipA:
id ......... ClipA ......... ClipB ......... ClipC
0001 ......... yes ......... no ......... yes
0003 ......... yes ......... no ......... no
0002 ......... no ......... yes ......... yes
if user choose sort content by ClipB:
id ......... ClipA ......... ClipB ......... ClipC
0002 ......... no ......... yes ......... yes
0001 ......... yes ......... no ......... yes
0003 ......... yes ......... no ......... no
if user choose sort content by ClipC:
id ......... ClipA ......... ClipB ......... ClipC
0001 ......... yes ......... no ......... yes
0002 ......... no ......... yes ......... yes
0003 ......... yes ......... no ......... no
Therefore, basicly I just want to sort this array $test by the sub-array $test[x][$content] base on user selection.
Am I make myself clear?