可以使用 PHP 的 strtr 函数来实现:$str = "728e1431b2afe24800c09d37c2a234a8382d69eb";$from = "ebafcd";$to = "mjinkl";$result = strtr($str, $from, $to...
Category : 程序学习
php获取最后面的字符串
使用 PHP 的 substr 和 strrpos 函数来实现$str = "xxx://xxx.xxx.xxx/nqtm/api/i381085k2ij708j2i77j9847316nm66in0695n25";$last = substr($str, strrpos(...
正则匹配网址http,https
正则表达式匹配http或https协议的URL:复制代码^(http|https)://[a-zA-Z0-9-.]+(.[a-zA-Z]{2,3})?(:[0-9]{1,5})?(/.*)?$解释:^:匹配字符串的开始位置(http|https):匹配http或https协...
nginx+lua 实现token防盗
-- 验证token文件-- 2020/01/08 16:25-- 更新缓存时间ngx.update_time();local ntime = ngx.time();local uri = ngx.var.uri;-- 获取请求参数local args = ngx...
lua+redis实现ip限流cc防护功能
-- cc防护-- 2020/03/08 11:30-- 加载并编译外部运行脚本 dofile("../lua/system_conf.lua")dofile("../lua/function.lua") local server_name = ngx.var.serve...