- print_r: documentation ( source)
<?php
$fruits = ['apple', 'orange', 'melon', 'banana', 'pineapple'];
foreach ($fruits as $key=>$fruit) {
if (in_array($fruit, ['apple', 'orange', 'melon', 'banana'])) {
unset($fruits[$key]);
}
}
print_r($fruits);