Php: remove (different cases) duplicates from array -


probably discussed topic, in php did not found answer there simpler way realize in follows:

$a = array("hello","hello","hello","world","world"); $p=array(); foreach( $a $v ){     $p[strtolower($v)] = ""; } print_r($p); 

keep 1 single element, in small-case, array

something like:

$p = array_unique(array_map('strtolower', $a)); 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -