a linear version https://pastebin.com/QJvnxc1A , but still far from the best solutions to php ..
danforth, ну да, если так, тогда этот фильтр не поможет...
Danforth, yes, if so, then this filter will not help ...
danforth, учел 0 и отрицательное число https://pastebin.com/JDPYysWF.
Danforth, took into account the 0 and a negative number https://pastebin.com/JDPYysWF .
можно добавить проверку на отрицательное число и фильтровать в обратную сторону, но все равно это однозначно быстрее, чем без подобного фильтра.
you can add a check for a negative number and filter in the opposite direction, but it is still clearly faster than without such a filter.
Пример реализации на php https://pastebin.com/xxQ1TZ10
EXAMPLE implementation on php https://pastebin.com/xxQ1TZ10
SeVlad, насколько я понял, речь идет не про url, а про поле названия темы.