I'm trying to figure out why a variable isn't triggering a conditional that it should. var_dump reports something like this:
string(20) "0"
Why is it reporting a length of 20 when the length is clearly 1?
The function var_dump() displays structured information (type and value) about one or more expressions/variables. Arrays and objects are explored recursively with values indented to show structure. All public, private and protected properties of objects will be returned in the output.
PHP | var_dump() Function The var_dump() function is used to dump information about a variable. This function displays structured information such as type and value of the given variable. Arrays and objects are explored recursively with values indented to show structure.
It might be rendering html. i.e. var_dump('<p class="abc">0</p>')
would output string(20) "0"
to the naked eye
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