I have two arrays
1.$ids;
Array
(
[0] => 2427975642
[1] => 2397521678
)
2.$c
Array
(
[48] => 2397521678
[46] => 461
[45] => 451
)
Question: Search values from $ids in $c and return new array with id. Example return 48
I have two arrays
1.$ids;
Array
(
[0] => 2427975642
[1] => 2397521678
)
2.$c
Array
(
[48] => 2397521678
[46] => 461
[45] => 451
)
Question: Search values from $ids in $c and return new array with id. Example return 48
$ids = array(
2427975642,
2397521678
);
$c = array(
48 => 2397521678,
46 => 461,
45 => 451
);
$finalArray = array();
foreach ( $c as $key=>$val)
{
if ( array_search($val,$ids))
{
$finalArray[]=$key;
}
}