欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

分析一下spinrtf函数这段代码的匹配含义

程序员文章站 2022-05-25 22:38:39
...
$pattern = sprintf('/(?:,\s*|^)\%Qs\E(?=,\s*|$)/m', $this->input->ip_address());

        // Returns 1, 0 or FALSE (on error only). Therefore implicitly convert 1 to TRUE
        if (preg_match($pattern, $this->config->item('rest_ip_blacklist')))

回复内容:

$pattern = sprintf('/(?:,\s*|^)\%Qs\E(?=,\s*|$)/m', $this->input->ip_address());

        // Returns 1, 0 or FALSE (on error only). Therefore implicitly convert 1 to TRUE
        if (preg_match($pattern, $this->config->item('rest_ip_blacklist')))

就是匹配黑名单中的IP

相关标签: php