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