I want something sorted like this:
$criteria->order = 'myField asc doesn't get things quite right, as MySQL has not native "natural sorting".
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It only takes a minute to sign up.Sign up to join this community
You can fake it by first sorting by character length, and then by the value:
$criteria->order = 'CHAR_LENGTH(myField) asc, myField asc
Its not perfect, but in certain cases, it will be all you need. Other methods exist as well: https://stackoverflow.com/a/8557307/935398
CHAR_LENGTH is a MySQL function that is getting passed directly to the
ORDER BY clause. It has nothing to do with Craft directly.