Answers for "php add multiple values in array"

PHP
1

in array php multiple values

$haystack = array(...);

$target = array('foo', 'bar');

if(count(array_intersect($haystack, $target)) == count($target)){
    // all of $target is in $haystack
}

if(count(array_intersect($haystack, $target)) > 0){
    // at least one of $target is in $haystack
}
Posted by: Guest on May-26-2020
2

php combine values of two arrays

$all_arrays = array_merge($array1, $array2, $array3, ...);
Posted by: Guest on October-31-2020

Code answers related to "php add multiple values in array"

Browse Popular Code Answers by Language