I have an array and it has repeating items. So I trying to delete item if it repeats. For example:
$links:
string(35) "/mjr/semba-tower/outline/index.html"
[1]=>
string(38) "/mjr/mc-futsukaichi/outline/index.html"
[2]=>
string(31) "/mjr/chihaya/outline/index.html"
[3]=>
string(35) "/mjr/semba-tower/outline/index.html"
As you see 2 semba-towers in the array and I want to delete one of if. I tried this, but output returns 0 item.
$output = [];
foreach(array_count_values($links) as $value => $count)
{
if($count == 1)
{
$output[] = $value;
}
}
var_dump($output);
Any other way to fix this problem?