1 <?php 2 header("Content-type:text/html;charset=utf-8"); 3 if($_POST){ 4     $pattern = array( 5                 '/ /',  //半角下空格 6                 '/ /',  //全角下空格 7                 '/
/',//window 下换行符 8                 '/
/', //Linux,Unix 下换行符 9          );10     $replace = array(' ',' ','<br />');11     $message=preg_replace($pattern, $replace, $_POST['message']); 
12     $cikuStr=file_get_contents('ciku.txt');13     $cikuArr=explode('|',$cikuStr);14     $liuyan=str_replace($cikuArr, "**",$message);15     echo '您的留言是:<br>'.$liuyan;16 }17 ?>3 4 6 7 8 9
效果截图如下所示:


| 欢迎光临 一起源码网 (https://www.171739.xyz/) | Powered by Discuz! X3.3 |