php mb_regex_encoding
发表于|更新于|php
mb_regex_encoding — 设置/获得 多字节正则表达式 字符编码 如:中文
文章作者: developer
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Dev!
相关推荐
2015-09-11
魔术方法__call
如果你试着调用一个对象中不存在的方法,__call 方法将会被自动调用。
2015-12-09
mb_strimwidth
按字符宽度获取 mb_strimwidth ( string $str , int $start , int $width [, string $trimmarker [, string $encoding ]] ) 参数说明: $str //指定字符串 $start //指定从何处开始截取 $width //截取文字的宽度 $trimmarker //超过$width数字后显示的字符串 $encoding //设置字符编码【例如:UTF-8】 举个例子来说明 <?php $string=”242432反对感是456犯得上广泛大使馆地方7890”;echo mb_strimwidth($string,0,14,’…’,’UTF-8’);?> 输出的结果就是:242432反对…
2015-09-10
mysql_insert_id
mysql_insert_id获得mysql查询后的自增主键的id
2019-08-30
php SplQueue php标准库 队列 和数组 性能差异
数组模拟队列12345678910111213141516171819$t1 = microtime(true);$arrq = array();for ($i = 0; $i < 100000; $i++) { $data = "hello $i\n"; array_push($arrq, $data); if ($i % 100 == 99 and count($arrq) > 100) { $popN = rand(10, 99); for ($j = 0; $j < $popN; $j++) { array_shift($arrq); } }}$popN = count($arrq);for ($j = 0; $j < $popN; $j++) { array_shift($arrq);}$t2 = microtime(true);echo ($t2 -...
2019-09-05
PHP 获取 对象唯一id spl_object_hash
1234567// 对象spl_object_hash测试$object = new stdClass;$id = spl_object_hash($object);var_dump($id); // 00000000408de7e4000000006ad86d42$object->id = 1;$id = spl_object_hash($object);var_dump($id); // 00000000408de7e4000000006ad86d42 注意When an object is destroyed, its hash may be reused for other objects.当对象被销毁时候,这个哈希id可能被其他对象重用
2019-03-03
thinkphp beego swoft yaf 性能测试 压力测试 php go swoole 速度对比 数据读取
1ab -n 10000 -c 200 统一使用ab在200并发进行10000次请求 为更接近实际使用,用各自模型读取了一条数据 测试机为腾讯云1核1G普通云硬盘,如果用ssd的话php成绩会有所提升 用nginx做转发,会限制golang性能发挥,压测nginx静态页面大概2157qps 首先需要说明,swoft和beego在裸跑时,效率爆棚,几乎逼近处理静态文件,速度是thinkphp的6-7倍.增加nginx后有了较大耗损,差不多是thinkphp的1.7倍.受制于nginx和fpm,yaf这种框架也只是比thinkphp提升了一丢丢,实际意义已经不大 thinkphp+nginx253大部分请求都比较慢,但是基本上是0.8S左右 12345678910111213141516171819202122232425262728Concurrency Level: 200Time taken for tests: 39.601 secondsComplete requests: 10000Failed requests: 0Tota...
公告
This is my Blog