- print_r: documentation ( source)
- stripos: documentation ( source)
<?php
$array = array(
'Bob' => 2,
'Theresa' => 3,
'The farm house' => 2,
'Bob at the farm house' => 1,
);
$result = $array;
$removed = $result;
foreach($result as $key => $value) {
foreach($result as $test => $value) {
if (false !== stripos($test, $key)) {
unset($result[$key]);
}
}
}
print_r($result);