Home > Backend Development > PHP Tutorial > java软件工程师学php - 2. 非布尔类型可强行用作布尔类型

java软件工程师学php - 2. 非布尔类型可强行用作布尔类型

WBOY
Release: 2016-06-13 13:10:11
Original
996 people have browsed it

java程序员学php - 2. 非布尔类型可强行用作布尔类型
只要数据不是0,那它就可以当作true来用; 否则,就当作false来用。

if("abc") {
   echo "abc"; //will print "abc"
}

if(!"0"){
   echo "zero"; //will print "zero"
}

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template