![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
php
shenmdyw
这个作者很懒,什么都没留下…
展开
-
php 中文、多字节字符通过位置替换
通过mb_str_split —给定一个多字节字符串,返回其字符数组 $arr=mb_str_split($string); $pos=mb_strpos($string,"a"); $arr[$pos]="*"; $string=join('',$arr);原创 2022-05-07 17:34:31 · 310 阅读 · 0 评论 -
file_get_contents超时设置时间
$url = 'http://www.google.com.hk'; $opts = array( 'http' => array( 'timeout' => 3, ) ); $context = stream_context_create($opts); $n = 0; while ($n < 5 && ($result = file_get转载 2015-08-28 15:16:37 · 403 阅读 · 0 评论