__file__
当前正在处理的脚本文件名。如果使用在一个被包含的文件中,那么它的值就是这个被包含的文件,而不是包含它的文件名。
__line__
正在处理的文件的当前行数。
php_version
表示php处理器的当前版本,如:'3.0.8-dev'。
php_os
php处理器所在的操作系统名字,如:'linux'。
true
真值
false
假值
可以用define函数定义更多的常量。
如,定义常量:
<?php
define("constant", "hello world.");
echo constant; // outputs "hello world."
?>
用 __file__ 和 __line__ 的举例
<?php
function report_error($file, $line, $message) {
echo "an error occured in $file on line $line: $message.";
}
report_error(__file__,__line__, "something went wrong!");
?>
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!