Home >Backend Development >PHP Tutorial >Several uncommon but particularly useful PHP predefined variables
1. $php_errormsg — Previous error message
<?php @strpos(); echo $php_errormsg; ?>
2. $http_response_header — HTTP response header
<?php function get_contents() { file_get_contents("http://example.com"); var_dump($http_response_header); } get_contents(); var_dump($http_response_header); ?>
3. $argc — Passed to Number of parameters of the script
<?php var_dump($argc); ?> 当使用这个命令执行: php script.php arg1 arg2 arg3
4. $argv — Array of parameters passed to the script
<?php var_dump($argv); ?> 当使用这个命令执行:php script.php arg1 arg2 arg3
For more PHP related technical articles, please visit the PHP Tutorial column to learn!
The above is the detailed content of Several uncommon but particularly useful PHP predefined variables. For more information, please follow other related articles on the PHP Chinese website!