Evaluation of variables to True or False in PHP

Variables other than Boolean type can be evaluated to truth or false in PHP.

Strings of non-zero length are evaluated to True.

Non-zero integers are evaluated to True, zero integers are evaluated to False. This principle applies to whole numbers as well as numbers with floating point.

null is evaluated to False.

YouTube video

Comments

Popular posts from this blog

Absolute and relative path in HTML pages

Errors

goto PHP operator