Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. usort($customers_list, function($a,$b) use ($sortby_name){
  2. $a_temp = mb_strtolower($a[$sortby_name]);
  3. $b_temp = mb_strtolower($b[$sortby_name]);
  4.  
  5. if(preg_match_all("/Đ/", $a_temp) || preg_match_all("/đ/", $a_temp)){
  6. $a_temp = str_replace('đ', 'dz', $a_temp); // str_replace('/\đ/g', 'd', );
  7. }
  8.  
  9. if(preg_match_all("/Đ/", $b_temp) || preg_match_all("/đ/", $b_temp)){
  10. $b_temp = str_replace('đ', 'dz', $b_temp); // str_replace('/\đ/g', 'd', );
  11. }
  12. return iconv('UTF-8', 'ASCII//TRANSLIT', $a_temp) > iconv('UTF-8', 'ASCII//TRANSLIT', $b_temp);
  13. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement