R
R
Roman Kuzmenko2015-12-12 02:16:44
PHP
Roman Kuzmenko, 2015-12-12 02:16:44

How to sort correctly in php?

Hello!
Please tell me which function to use in order to sort the array correctly, that is, regardless of the specials. characters in the form "." (dots).
ACA CERAMICAS
ALCO CERAMICHE
ABK
ABSOLUTE KERAMIKA
ACIF

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wol_fi, 2015-12-12
@wol_fi

usort($array, function($a, $b){
     return strcmp(str_replace('.', '', $a), str_replace('.', '', $b));
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question