PHP printed boolean value is empty, why?

后端 未结 4 861
清歌不尽
清歌不尽 2020-12-01 14:10

I am new to PHP. I am implementing a script and I am puzzled by the following:

$local_rate_filename = $_SERVER[\'DOCUMENT_ROOT\'].\"/ghjr324l.txt\";
$local_r         


        
4条回答
  •  生来不讨喜
    2020-12-01 14:35

    The results come from the fact that php implicitly converts bool values to strings if used like in your example. (string)false gives an empty string and (string)true gives '1'. That is consistent with the fact that '' == false and '1' == true.

提交回复
热议问题