Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php add to array if not exists

$a=array();
// organize the array
foreach($array as $k=>$v){
    foreach($v as $key=>$value){
        if(!in_array($value, $a)){
        	$a[]=$value;
        }
    }
}
 
PREVIOUS NEXT
Tagged: #php #add #array #exists
ADD COMMENT
Topic
Name
1+2 =