php/mysql natural sort
php: $fruits["orange1"]="martin petrov 1"; $fruits["orange2"]="martin petrov 2"; $fruits["orange20"]="martin petrov 20"; $fruits["orange3"]="martin petrov 3"; natsort($fruits); foreach ($fruits as $key => $val) { echo "$key = $val\n"; } mysql: SELECT alphanumeric, integer FROM sorting_test ORDER BY LENGTH(alphanumeric), alphanumeric
Прочети цялата публикация