Hi friends, I have two arrays say original[] and input[]. In the first array i have 3 values 1 2 3 Code (markup): and in the second array i give 2 values 2 3 Code (markup): I want to check if these two values are present in the first array How can i do this? Thanx
If i understood you correctly; <?php $array1 = array(1, 2, 3); $array2 = array(2, 3); foreach($array2 as $ele) { if(in_array($ele, $array1)) print "Array value $ele exists in array1\n"; } ?> PHP: For more information on the above, which is pretty simple, see the in_array docs; http://php.net/manual/en/function.in-array.php