The source code to print the timestamp of the start of the request is given below. The given program is compiled and executed successfully.
<?php
//PHP program to print the timestamp
//of the start of the request.
$requestTime = $_SERVER['REQUEST_TIME'];
printf("Timestamp: %s<br>", $requestTime);
?>
Output:
Timestamp: 1604073329
Explanation:
In the above program, we used $_SERVER[REQUEST_TIME'] superglobal that returns the timestamp of the start of the request, which is assigned to the variable $request. After that, we printed the timestamp using printf() on the webpage.
Program/Source Code:
The source code to print the timestamp of the start of the request is given below. The given program is compiled and executed successfully.
Output:
Explanation:
In the above program, we used $_SERVER[REQUEST_TIME'] superglobal that returns the timestamp of the start of the request, which is assigned to the variable $request. After that, we printed the timestamp using printf() on the webpage.
need an explanation for this answer? contact us directly to get an explanation for this answer