打赏

2018年12月12日

替换字符串中间位置字符为星号

摘要: <?php function half_replace($str){ $len = strlen($str)/2; return substr_replace($str,str_repeat('*',$len),ceil(($len)/2),$len); } $str = 'CEAWONUR'; echo half_replace($str);//輸出CE****UR 阅读全文

posted @ 2018-12-12 11:01 头大的冯冯 阅读(346) 评论(0) 推荐(0) 编辑

导航