- print_r: documentation ( source)
- array_filter: documentation ( source)
<?php
$fruits = ['apple', 'orange', 'melon', 'banana', 'pineapple'];
$fruits = array_filter($fruits, function($fruit) {
return !in_array($fruit, ['apple', 'orange', 'melon', 'banana']);
});
print_r($fruits);