OK, there are a lot of examples of duplicate detection and removal in php arrays, using array_unique() etc but what if you want to find dups, modify them, check again in a loop until all dups are now unique?
我认为,它像使用阵列(过滤器)一样,是一个更具体的例子,在这里,它会引出象这样一句 statement语的话:
SELECT id, list.comboname
FROM list
INNER JOIN (
SELECT comboname
FROM list
GROUP BY comboname
HAVING count(id) > 1
) dup ON list.comboname = dup.comboname
表中的一系列重复:
Array (
[0] => 49
[1] => big.dup
[2] => 233
[3] => another.duplicate
[4] => 653
[5] => big.dup
[6] => 387
[7] => big.dup
[8] => 729
[9] => another.duplicate
[10] => 1022
[11] => big.dup
)
现在,我想要的是一些PHP,以便在这段时期之前删除其特性,以便它们具有独特性[或者如果需要的话,就添加数字]。
结果是:
Array (
[0] => 49
[1] => big.dup
[2] => 233
[3] => another.duplicate
[4] => 653
[5] => big.du
[6] => 387
[7] => big.d
[8] => 729
[9] => another.duplicat
[10] => 1022
[11] => big.dup1
)
保留原有价值(即大宗和另一宗)。 页: 1 我只想看一下每一个PHP阵列功能,试图想象一项战略......想法?