晕,上次的哪个是手机号,这和上次的没有啥区别吧.
如果你的数据比较规则的话,比如说都是:
姓名 手机号,姓名 手机号,姓名 手机号将文件读取,然后用explode分隔,成数组,然后再用array_unique去掉重复的就OK了.
$strPhone = file_get_content("xx.txt");
$arrPhone = explode(',', $strPhone);
$arrUniquePhone = array_unique($arrPhone);
$strPhone = impolde(',', $arrUniquePhone);
file_put_contents("xx1.txt", $strPhone);