3 个 php 常量,我不确定它们是做什么的
The name says it all I can agree no more but there is a function called
<em>filter_var/input_array()</em> which works in similar fashion;
I've seen examples where recursive validation is required but
not all element in the array are arrays some items are just scalar value
Run Code Online (Sandbox Code Playgroud)
<?php
$x = 5;
$y = [1, 2, 3];
var_dump(filter_var($x,FILTER_REQUIRE_SCALAR));
var_dump(filter_var($y,FILTER_REQUIRE_SCALAR));
?>
Run Code Online (Sandbox Code Playgroud)
考虑产生
bool(false)
bool(false)
as use的 prev code可以看到$x 确实是 标量
总是返回一个数组这是我在phpDoc …