Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

assocititive multi array compare php


NOTE: the diff_array also removes all the duplicate values that match to the values in the second array:



<?php

    $array1 = array("a","b","c","a","a");

    $array2 = array("a");



    $diff = array_diff($array1,$array2);



    // yields: array("b","c") the duplicate "a" values are removed 

?>

Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #assocititive #multi #array #compare #php
ADD COMMENT
Topic
Name
3+1 =