Answer the question
In order to leave comments, you need to log in
Sort strings in array by numbers?
There is an array, it seems to be sorted alphabetically, there are file names:
f.pdf-0.jpg, f.pdf-1.jpg, f.pdf-10.jpg, f.pdf-11.jpg, f.pdf -12.jpg, ..., f.pdf-19.jpg, f.pdf-2.jpg, f.pdf-20.jpg, f.pdf-21.jpg ...
i.e. 0, 1, 10 , 11, ..., 2, 20, 21 ...
And I need to sort it by numbers so that it would be normal: 0, 1, 2, 3, ..., 9, 10, 11, ..., 19 , 20, 21...
Tell me how to do it? And then the text is not in order, but mixed.
Answer the question
In order to leave comments, you need to log in
https://www.php.net/manual/ru/function.sort.php
https://ideone.com/Ug6Axr
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question