关于PHP中的if语句

aho*_*ota 2 php if-statement

我见过一些类似的PHP语句

 if($variable) {} or
 if(function()) {} (if statements that don't compare two variables)
Run Code Online (Sandbox Code Playgroud)

我知道它们大致意味着如果一个函数执行或者这个变量存在但是我似乎找不到任何关于它们如何工作的信息.任何人都可以对此有所了解吗?

Tim*_*per 7

if(function()) {}表示如果函数函数的返回值为true或true,则块将执行.