**
**
array(5) {
[0]=>
array(2) {
["id"]=>
string(1) "2"
["content2"]=>
string(2) "XL"
}
[1]=>
array(2) {
["id"]=>
string(1) "1"
["content2"]=>
string(1) "L"
}
[2]=>
array(2) {
["id"]=>
string(1) "3"
["content2"]=>
string(3) "XXL"
}
[3]=>
array(2) {
["id"]=>
string(1) "4"
["content2"]=>
string(1) "L"
}
[4]=>
array(2) {
["id"]=>
string(1) "5"
["content2"]=>
string(2) "XL"
}
}
PHP multidimensional array sorting array
There is no regular pattern in clothing sizes, right? Should they be numbered in a certain order when inserted into the library and then sorted when taken out
Just write a bubble sort.
As for L<XL<XXL<XXL, just set up a map mapping for comparison.
You can also use
usort
to customize the sorting logic. Reference:http://php.net/manual/zh/func...
I just wrote it casually, not sure if this is what you want.