PHP Superglobals and Functions Flashcards
contains information about the
server environment and the current request
$_SERVER
contains any data that was sent to the
script through a GET request.
$_GET
contains any data that was sent to the
script through a POST request.
$_POST
contains any uploaded files that were
sent to the script through a POST request. This superglobal is
used when handling file uploads.
$_FILES
superglobal contains any cookies that were
sent to the script by the client browser.
$_COOKIE
contains any session variables
that have been set
$_SESSION
superglobal contains the contents of $_GET,
$_POST, and $_COOKIE.
$_REQUEST
contains any environment variables
that have been set on the server.
$_ENV
superglobal contains all global variables
that have been defined in the script. It can be used to
access variables from within a function or other local
scope.
$GLOBALS
function is used to find the length of a string.
strlen()
function is used to replace a string with
another string.
str_replace()
function is used to count the number of
elements in an array.
count()
function is used to add one or more
elements to the end of an array.
array_push()
function is used to remove the last
element from an array.
array_pop()
function is used to format a date and time.
Syntax: date(format, timestamp)
date()
DATE FUNCTION