<?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 ($k === $key) { continue; } if (false !== stripos($k, $key)) { unset($baseTags[$key]); } } } print_r($baseTags);
You have javascript disabled. You will not be able to edit any code.