considering that the variable only can be String fetched from an HTML Form (input-text, textarea).
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Yes, there is a difference between
strlen($str)==0
andempty($str)
.empty
returns true if the value is"0"
. See the PHP type comparison tables.Here is some note I've discovered:
empty(), requires a variable and only a variable, so I think it has a problem when it's dealing with an object value fetched from the magic __get() method.