Jump to content

comparing 2 arrays in a loop


dsaba

Recommended Posts

I have 2 arrays:

 

$array1[] = 'hello';

$array1[] = 'how';

$array1[] = 'are';

$array1[] = 'you';

$array1[] = 'bob';

 

$array2[] = 'hello how';

$array2[] = 'are you steve';

 

I want to compare $array1 with $array2, and if any value of $array1 is found in $array2 I want to perform an action

 

I know this has to be in a loop, i'm confused about how to set it up

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/48432-comparing-2-arrays-in-a-loop/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.