php array_iunique case insensitive no latin values -


hello have string might include duplicate strings-words example "Το το" far have this:

function array_iunique($array) {     return array_intersect_key($array,array_unique(array_map('mb_strtolower',$array))); } 

array_iunique

when test string in english "to to" works great , outputs array 1 value, when try greek string mentioned above doesn't. missing here ?

expected result return 1 word , i'm interested in greek only.

for might have same issue solves issue:

function array_iunique($array) {     return array_intersect_key(         $array,         array_unique(             array_map(                 function($text) {                     return mb_strtolower($text, 'utf-8');                 },                 $array             )         )     ); } 

ref


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -