I have one multidimensional array:
Array
(
[0] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1201
)
[1] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1200
)
[2] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1196
)
[3] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1193
)
)
and I want to remove array which values are match with property_id:
Array
(
[0] => 1201
[1] => 1200
[2] => 1193
)
and I want this result:
Array
(
[0] => stdClass Object
(
[user_type] => U
[user_id] => 156
[property_id] => 1196
)
)
I am sharing my code for what i have done:
for($b=0; $b<count($beBounceResults); $b++){
$beBounceProID[] = $beBounceResults[$b]->property_id;
}
// Getting thus array in this variable $beBounceProID
Array
(
[0] => 1201
[1] => 1200
[2] => 1193
)
$counter = "0";
foreach ($results as $key => $value){
if($results[$key]->property_id == $beBounceProID[$counter]){
unset($results[$key]);
}
$counter++;
}
but after that I am getting Notice: Undefined offset:
Any idea what I am doing wrong.
Thanks.