HTTP
stands for Hypertext Transfer Protocol.
The standard (default) port for HTTP
connection is 80
, but other port can also be used
HTTP does not have any security
...
HTTPS
stands for Hypertext Transfer Protocol Secure. HTTPS has a secure transfer.
The standard port in HTTPS
to transfer the information is 443
HTTPS protocol uses HTTP on connection encrypted by SSL or TLS (therefore it's secure)Accept: text/html, application/xml,...
List of acceptable encodings (HTTP compression types)Accept-Encoding: gzip, deflate, br
An HTTP cookie previously sent by the server with Set-Cookie (below)Cookie: _ga=GA1.2.588481944.1592916481; _fbp=fb.1.1592916481604.1420873611; ...
The user agent string of the user agent (browser identifier string)User-Agent: Mozilla/5.0 (Linux...
Authentication credentials for HTTP authenticationAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
The email address of the user making the requestFrom: user@example.com
The length of the request body in octets (8-bit bytes).Content-Length: 348
...
Note:browsers that do not support compliant compression method will download uncompressed data
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
The type of encoding used on the dataContent-Encoding: gzip
The MIME type of this contentContent-Type: text/html; charset=UTF-8
A name for the serverServer: nginx
The date and time that the message was sentDate: Fri, 30 Oct 2020 14:42:53 GMT
Gives the date/time after which the response is considered staleExpires: Thu, 01 Dec 1994 16:00:00 GMT
$argv
contains filename and parameters, when the php script
is called through command line (cmd). test_args.php
file content:<?php
echo 'Filename:'.$argv[0]."; ";
echo 'First parameter:'.$argv[1]."; ";
echo 'Second parameter:'.$argv[2]."; ";
If we run the command: php test_args.php first-param second-param
in cmd
the script above will output the following:Filename:test_args.php; First parameter:first-param; Second parameter:second-param;
getmypid
- Gets PHP's process IDecho 'Current process ID:' . getmypid();
The output will be:Current process ID:4868
register_shutdown_function('myexit');
function myexit()
{
echo "</schedule>";
}
http_response_code
Sets HTTP response status code 404
http_response_code(404);
$Datetime_object = DateTime::createFromFormat('Y-m-d', "2020-12-23");