I have an array
like this:
array(1) {
[0]=>
string(16) "1785328791698338"
}
And other array
like this:
array(7) {
[0]=>
string(17) "10207252567926988"
[1]=>
string(17) "10208823390691752"
[2]=>
string(17) "10209064245580796"
[3]=>
string(16) "1274474365912572"
[4]=>
string(16) "1294280923934896"
[5]=>
string(16) "1317727711586522"
[6]=>
string(16) "1785328791698338"
}
I should check if some of the elements(in this case only one, but it can vary) from first array are same as some elements in second array, and if they are, to remove them from first array. I tried doing it this way, but it does't work:
function findSameValuesOfArrays($arrayOne,$arrayTwo){
$newArray=array();
foreach($arrayOne as $a){
$newArray[0]=$a;
}
foreach($arrayTwo as $b){
$newArray[1]=$b;
}
if (strpos($newArray[1],$newArray[0])) {
return true;
}
}
This is just to find if there are same elements, and then i would probably unset key where those values are. But function returns NULL
.