Answers for "php return multiple values"

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
0

php function return multiple values

// Function to swap two numbers 
function swap( $x, $y ) {  
    return array( $y, $x ); 
}
Posted by: Guest on October-01-2020

Code answers related to "php return multiple values"

Browse Popular Code Answers by Language