Answer the question
In order to leave comments, you need to log in
Wrong sorting in javascript?
Good afternoon, there is an array with the names:
Petrov, Ivanov, User 1, User 2 ... User 11 ... User 21 ...
For some reason, when I sort (using angular, by the way, and not only - I got the same answer) - I get the answer
Ivanov
Petrov
Sidorov
User 1
User 11
User 2
User 22
...
I don’t understand what kind of sorting is so clumsy? (User 11 should be after User 2 and in general after Petrov ... well, t .d.)
How to make it sorted like normal people? )))
Answer the question
In order to leave comments, you need to log in
It's simple, you need to add exceptions to the CNC, I will show the Bitrix example, the sign is NOT!
RewriteCond %{REQUEST_FILENAME} !-f # если это не файл
RewriteCond %{REQUEST_FILENAME} !-l # и если это не линка
RewriteCond %{REQUEST_FILENAME} !-d # и если это не директорие ( то есть по сути любые физические файлы и каталоги)
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$ # и внимание если это этот файл ! в данном случае чтб небыло цикла.
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L] # То перенаправить все запросы туда
Submit the contents of .htaccess. Strings
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
should check for the presence of folders and files, but you can do something likeRewriteCond %{REQUEST_URI} !^/(magazine) [NC]
Use the "natural" sorting algorithm.
Here is the finished solution
Everything is logical. You are sorting the rows. So it was always and everywhere.
Pay attention to the sort order of files in the OS for example.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question