Loading

Super global variable $php_errormsg, $http_response_header, $argc, $argv

$php_errormsg — $php_errormsg is a variable, That contains the PHP-generated text of the last error message. In PHP.ini if track_errors will on then it will work.
This variable will only be available within the scope in which the error occurred.
It can be set using a user-defined error handler (set_error_handler())
$http_response_header — HTTP response headers is an array response. which is populated with the HTTP header response and an array is created in the local scope of PHP.
Example:-
<?php
function get_contents() {
file_get_contents(“http://example.com”);
var_dump($http_response_header); // variable is populated in the local scope
}
get_contents();
var_dump($http_response_header); // a call to get_contents() does not populate the variable outside the function scope
?>
$argc — The number of arguments passed to the current script when running from the command line.
Example:-
<?php
var_dump($argc);
?>
 $argv —It contains an Array of arguments passed to the script when running from the command line.
Example:-
<?php
var_dump($argv);
?>

 

Leave a Reply

z35W7z4v9z8w
Verified by ExactMetrics