Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Php match values between 2 arrays

Tags:

arrays

php

Guys i have a very awkward situation here , i am not sure whether am i taking a right approach or not.. i am trying to match the values between 2 arrays and then running if else statement... here's goes what i am trying to do

$array1 = array('html','php','js','css');
$array2 = array('php','python','html','java');

what i want is to make a check where the values of these 2 arrays matches to each other. like php and html is common in both and also where it doesn't match.

Thanks

like image 415
Aman Virk Avatar asked Nov 07 '11 15:11

Aman Virk


1 Answers

You mean like an intersection?

like image 72
CodeCaster Avatar answered Oct 05 '22 05:10

CodeCaster