PHP实现批量替换字典后缀

Posted 水清云影

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP实现批量替换字典后缀相关的知识,希望对你有一定的参考价值。

<?php
//要打开字典的物理路径
$filename = \'E:\\Local Test\\WWW\\password.txt\';
$handle = fopen($filename,\'r\') or die(\'文件打开失败\');
//读取字典
$contents = fread($handle,filesize(\'E:\\Local Test\\WWW\\password.txt\'));
fclose($handle);
$text = explode(\'
\',$contents);
foreach($text as $key=>$value){
    //修改要生成的邮箱后缀
    $text[$key] = $value.\'@qq.com<br>\';
    print_r($text[$key]);
}
?>

以上是关于PHP实现批量替换字典后缀的主要内容,如果未能解决你的问题,请参考以下文章