我遇到了array_unique
问题,其中重复值未被删除。array_unique不删除重复项
<?php
$mfgName = 'blah';
$prodModel = '178.211';
$name ='178.211 remove this number';
$input = array($mfgName, $prodModel, $name);
$st =array_unique($input);
$str= implode(' ', $st);
echo $str;
?>
输出应该是:
blah 178.211 remove this number
,但我得到:
blah 178.211 178.211 remove this number
'胡说!= 178.211!= 178.211删除此number' –
我没有在这里看到的问题吗?这似乎是一切应该如何工作。听起来你需要编写你自己的'unique'函数来检查每个字符串中每个字符串的索引。 – JosephGarrone
请检查这个[链接](http://php.net/manual/en/function.array-unique.php)知道array_unique是如何工作的! –