Fixing ‘Can’t use function return value in write context’ in PHP
- Article
- Comment
Fixing ‘Can’t use function return value in write context’ in PHP. The error comes when your php is lower than 5.5. Yes, if you upgrade your php version the problem may be solved. if you dont want to upgrade your php, than check the error line, you have write something similar to the following one.
empty(trim($variable))
Instead of this function, just write like the following one.
trim($variable) == false
The same problem i faced, and tried this way, it helped me to solve the issue. if you dont see such a things, than it might be the bracket error. instead of ‘[‘ you may used ‘(‘. So check it carefully, than the issue may be solved. Generally the error occurs with the “empty(), trim(), or the isset() ” . So check it very closely.