
PHP
mjq663
这个作者很懒,什么都没留下…
展开
-
TP6获取控制器名,方法名
第一种:助手函数调用 Request()->controller(); //获取控制器名 Request()->action(); //获取方法名 第二种:门面函数facade的静态调用 \think\facade\Request::action(); \think\facade\Request::controller(); 第三种:app类的静态调用,注意此App为 use think\facade\App; (App::class)::make('request')->转载 2021-04-23 08:53:03 · 2048 阅读 · 0 评论 -
php 中文unicode 互转
/** * $str 原始中文字符串 * $encoding 原始字符串的编码,默认GBK * $prefix 编码后的前缀,默认"&#" * $postfix 编码后的后缀,默认";" */ function unicode_encode($str, $encoding = 'GBK', $prefix = '&#', $postfix = ';') { $str转载 2014-07-03 15:30:37 · 345 阅读 · 0 评论