An student here who needs help with the logic of the following:
I have two arrays.
$array1 contains the ids of the places the user has been to.
$array2 contains the ids of the places where the user can obtain one point just by visiting them
Now I need to know if the user has visited any of the places where he/she can get one point so I can grant it to him/her. How can I do that?
Tnaks a lot
Looks like you want to try array_intersect
$intersection = array_intersect($array1, $array2);
count(array_intersect($array1, $array2)) should then give you the number of suych places.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With