1.GETCWD () and =__file__ differences
<?php
$a = GETCWD ();
The value of variable A is D:\PHP\ZEND6.1\CH6
$b =__file__;
The value of variable B is D:\php\zend6.1\ch6\test.php
?>
This shows that GETCWD () returns the absolute path of the file, but not the name of the file itself. __FILE__ is the absolute path where the file is located, but with the name of the file itself.
<?php
Include_once '. /test.php ';
echo $a;//The value in variable A is D:\PHP\ZEND6.1\CH6\ADMINCP
Echo ' <pre> ';
echo $b;//The value in variable B is D:\php\zend6.1\ch6\test.php
?>
This shows that the test.php file is included in another file. The path variable A of test.php obtained with GETCWD () in the test.php file changes after it has been contained. The directory structure is added to the ffff.php directory ADMINCP, so • __file__ better when locating files
2.version_compare
Compare PHP Versions
3.phpversion (' Extended name ')
Returns the current PHP version, with parameters indicating the current extended version
Php Xiao Ji (a)