我可以帮助您进行翻译。以下是需要翻译的内容:
因此,结果应该是替换了重复值的相同数组。
我需要制作一个应用程序,它将使用一些随机值填充数组,但如果数组中有重复项,则我的应用程序无法正常工作。因此,我需要编写脚本代码来查找重复项并用其他值替换它们。 好的,例如我有一个数组:
<?PHP
$charset=array(123,78111,0000,123,900,134,00000,900);
function arrayDupFindAndReplace($array){
// if in array are duplicated values then -> Replace duplicates with some other numbers which ones I'm able to specify.
return $ArrayWithReplacedValues;
}
?>
因此,结果应该是替换了重复值的相同数组。
array_unique()
和array_replace()
,它们可能正是您所需的。 - newfurniturey