I know this may be a silly question, but I come across a snippet of php code that check if the $_POST is_array() before execute other functions.
Now I guess that $_POST should be always an associative array or not? is this check really needed? and why?
If it hasn't been changed in some manner like
$_POST = 'not array';
then it is array ;-)
$_POST is always an array, they're probably checking if a certain $_POST value is an array.
<input name="test" /> $_POST['test'] is not an array
<input name="test[]" /> $_POST['test'] is an array
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With