wawos 发表于 2024-12-24 11:15:00

<div class="quote"><blockquote><font size="2"><a href="https://hostloc.com/forum.php?mod=redirect&goto=findpost&pid=16143869&ptid=1377117" target="_blank"><font color="#999999">我不是戏精 发表于 2024-12-24 11:27</font></a></font><br />
问得很好,下次别问了。找gpt</blockquote></div><br />
头像牛

入学申请 发表于 2024-12-24 11:18:07

<div class="quote"><blockquote><font size="2"><a href="https://hostloc.com/forum.php?mod=redirect&goto=findpost&pid=16143877&ptid=1377117" target="_blank"><font color="#999999">尼古丁真 发表于 2024-12-24 11:29</font></a></font><br />
在 PHP 中,filter_var() 函数用于对变量进行过滤和验证,并且可以接受一个标志参数(flags),该参数的作 ...</blockquote></div><br />
这么核心关键点, 在它php定义常量的数值上,<br />
<br />
他不是随便定义常量数字是多少, 而是通过一种规律确保多个常量无论怎么 &amp; | 运算后都是唯一<br />
<br />
是这样吧, 也就是自己的函数,自己的常量不能这样用

wawos 发表于 2024-12-24 11:19:38

究其原因就是第二个参数确定判断的类型,第三个参数传递这个类型下的options<br />
<br />
只要这些options二进制 主要标志位分开 不冲突就可以这样做<br />
<br />
比如你说的 ip判断<br />
<br />
<img id="aimg_VHjjb" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" src="https://i.imgur.com/K65R8zx.png" onmouseover="img_onmouseoverfunc(this)" onload="thumbImg(this)" border="0" alt="" /><br />
<br />
很明显这四个值对应的二进制都是1开头 后面都是0 <br />
只是位数不同<br />
使用| 进行位或运算 后结果就是10010000xxxx 类似于这样的<br />
函数就可以判断出来原始的参数变量<img id="aimg_ahGa1" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" src="https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif" onmouseover="img_onmouseoverfunc(this)" onload="thumbImg(this)" border="0" alt="" />

种植业生产人员 发表于 2024-12-24 12:56:11

<div class="quote"><blockquote><font size="2"><a href="https://hostloc.com/forum.php?mod=redirect&goto=findpost&pid=16143877&ptid=1377117" target="_blank"><font color="#999999">尼古丁真 发表于 2024-12-24 11:29</font></a></font><br />
在 PHP 中,filter_var() 函数用于对变量进行过滤和验证,并且可以接受一个标志参数(flags),该参数的作 ...</blockquote></div><br />
那可以用 &amp; 吗

Kvm 发表于 2024-12-24 11:31:02

filter_var里面做不到
页: 1 [2]
查看完整版本: 有懂php代码的吗