3 php constants i am not sure what they do
1. FILTER_REQUIRE_ARRAY
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
FILTER_REQUIRE_SCALAR
<?php
$x = 5;
$y = [1, 2, 3];
var_dump(filter_var($x,FILTER_REQUIRE_SCALAR));
var_dump(filter_var($y,FILTER_REQUIRE_SCALAR));
?>
Consider The prev code that produces
bool(false)
bool(false)
as use can see $x is indeed Scalar
FILTER_FORCE_ARRAY
Always returns an array This is all the documentation i found about this in phpDoc give me an example about this please