How php converts strings to bool types
This article mainly explains "how php converts strings to bool types". The explanation in this article is simple and clear and easy to learn and understand. please follow the editor's ideas to study and learn "how php converts strings to bool types".
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
Method 1: add the target type (bool) or (boolean) enclosed in parentheses before the string variable to be converted
Output result:
Method 2: use the boolval () function
Boolval (): used to get the Boolean value of the variable
Output result:
Thank you for your reading, the above is the content of "how php converts strings to bool types". After the study of this article, I believe you have a deeper understanding of how php converts strings to bool types, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!