1

I have products similar to:

125PPP 123ABC 124ABC 123DEF

How could I sort these products first by their digits (sizes) then in the case of the same digit - alpha?

I know I can split them up and sort an array of products by the digits, but what if 2 products use the same digits (2nd and 4th product in the example)?

Thank you.

4

2 に答える 2

-1
$array = array("125PPP", "123ABC", "124ABC", "123DEF");
sort($array);
print_r($array);
于 2013-05-15T03:47:58.790 に答える