Posts

Showing posts from May, 2024

To check the key is present in an array or not

 <?php $haystack = array('foo','b','bar'); $target = array('foo', 'bar'); if(count(array_intersect($haystack, $target)) == count($target)){     echo "present"; }else{     echo "not present"; } ?>