PHP cheatsheet -

Basic Syntax
Code
<?php //code ?>
Single-line comment
// comment
Multi-line comment
/* comment */
Predefined Variables
$GLOBALS
References all variables available in global scope
$_SERVER
Server and execution environment information
$_SERVER['PHP_SELF']
The filename of the currently executing script,example:http://lautturi.com/foo/bar.php(/foo/bar.php)
$_SERVER['SERVER_NAME']
The name of the server host under which the current script is executing.
$_SERVER['QUERY_STRING']
The query string, if any, via which the page was accessed.
$_SERVER['DOCUMENT_ROOT']
The document root directory under which the current script is executing
$_SERVER['HTTP_REFERER']
The address of the page (if any) which referred the user agent to the current page.
$_SERVER['SCRIPT_FILENAME']
The absolute pathname of the currently executing script.
$_SERVER['SCRIPT_NAME']
Contains the current script's path.
$_SERVER['REQUEST_METHOD']
'GET', 'HEAD', 'POST', 'PUT'
$_GET
HTTP GET variables
$_POST
HTTP POST variables
$_FILES
HTTP File Upload variables
$_REQUEST
HTTP Request variables
$_SESSION
Session variables
$_ENV
Environment variables
$_COOKIE
HTTP Cookies
$php_errormsg
The previous error message
$HTTP_RAW_POST_DATA
Raw POST data
$http_response_header
HTTP response headers
$argc
The number of arguments passed to script
$argv
Array of arguments passed to script
Logical Operators
$a and $b
TRUE if both $a and $b are TRUE
$a && $b
TRUE if both $a and $b are TRUE
$a or $b
TRUE if either $a or $b is TRUE
$a || $b
TRUE if either $a or $b is TRUE
$a xor $b
TRUE if $a or $b is TRUE,but not both TRUE
!$a
TRUE if $a is FALSE,else FALSE
Bitwise Logical Operators
$a & $b
Bits are set when both $a and $b are set
$a=0111, $b=1011, $a&$b = 0011
$a | $b
Bits are set either $a or $b is set
$a=0111, $b=1011, $a|$b = 1111
$a ^ $b
Bits are set either $a or $b is set but not both
$a=0111, $b=1011, $a^$b = 1100
~$a
Bits are set when $a is not set
$a=0111,~$a = 1000
$a << $b
shift left
$a=0111, $a << 2 = 11100
$a >> $b
shift right
$a=0111, $a >>2 = 0001
Comparison Operators
$a == $b
TRUE if $a is equal to $b
$a === $b
TRUE if $a is equal to $b and both same type
$a != $b
TRUE if $a is not equal to $b
$a <> $b
same as ($a != $b)
$a !== $b
TRUE if $a is not equal to $b,or they are not the same type
$a < $b
TRUE if $a is less than $b
$a <= $b
TRUE if $a is less than or equal to $b
$a > $b
TRUE if $a is greater than $b
$a >= $b
TRUE if $a is greater than or equal to $b
Array Functions
array_change_key_case
Changes the case of all keys in an array
array_chunk
Split an array into chunks
is_array
Finds whether a variable is an array
array_column
Return the values from a single column in the input array
array_combine
Creates an array by using one array for keys and another for its values
array_count_values
Counts all the values of an array
array_diff_assoc
Computes the difference of arrays with additional index check
array_diff_key
Computes the difference of arrays using keys for comparison
array_diff_uassoc
Computes the difference of arrays with additional index check which is performed by a user supplied callback function
array_diff_ukey
Computes the difference of arrays using a callback function on the keys for comparison
array_diff
Computes the difference of arrays
array_fill_keys
Fill an array with values, specifying keys
array_fill
Fill an array with values
array_filter
Filters elements of an array using a callback function
array_flip
Exchanges all keys with their associated values in an array
array_intersect_assoc
Computes the intersection of arrays with additional index check
array_intersect_key
Computes the intersection of arrays using keys for comparison
array_intersect_uassoc
Computes the intersection of arrays with additional index check, compares indexes by a callback function
array_intersect_ukey
Computes the intersection of arrays using a callback function on the keys for comparison
array_intersect
Computes the intersection of arrays
array_key_exists
Checks if the given key or index exists in the array
array_key_first
Gets the first key of an array
array_key_last
Gets the last key of an array
array_keys
Return all the keys or a subset of the keys of an array
array_map
Applies the callback to the elements of the given arrays
array_merge_recursive
Merge one or more arrays recursively
array_merge
Merge one or more arrays
array_multisort
Sort multiple or multi-dimensional arrays
array_pad
Pad array to the specified length with a value
array_pop
Pop the element off the end of array
array_product
Calculate the product of values in an array
array_push
Push one or more elements onto the end of array
array_rand
Pick one or more random keys out of an array
array_reduce
Iteratively reduce the array to a single value using a callback function
array_replace_recursive
Replaces elements from passed arrays into the first array recursively
array_replace
Replaces elements from passed arrays into the first array
array_reverse
Return an array with elements in reverse order
array_search
Searches the array for a given value and returns the first corresponding key if successful
array_shift
Shift an element off the beginning of array
array_slice
Extract a slice of the array
array_splice
Remove a portion of the array and replace it with something else
array_sum
Calculate the sum of values in an array
array_udiff_assoc
Computes the difference of arrays with additional index check, compares data by a callback function
array_udiff_uassoc
Computes the difference of arrays with additional index check, compares data and indexes by a callback function
array_udiff
Computes the difference of arrays by using a callback function for data comparison
array_uintersect_assoc
Computes the intersection of arrays with additional index check, compares data by a callback function
array_uintersect_uassoc
Computes the intersection of arrays with additional index check, compares data and indexes by separate callback functions
array_uintersect
Computes the intersection of arrays, compares data by a callback function
array_unique
Removes duplicate values from an array
array_unshift
Prepend one or more elements to the beginning of an array
array_values
Return all the values of an array
array_walk_recursive
Apply a user function recursively to every member of an array
array_walk
Apply a user supplied function to every member of an array
array
Create an array
arsort
Sort an array in reverse order and maintain index association
asort
Sort an array and maintain index association
compact
Create array containing variables and their values
count
Count all elements in an array, or something in an object
current
Return the current element in an array
each
Return the current key and value pair from an array and advance the array cursor
end
Set the internal pointer of an array to its last element
extract
Import variables into the current symbol table from an array
in_array
Checks if a value exists in an array
key_exists
Alias of array_key_exists
key
Fetch a key from an array
krsort
Sort an array by key in reverse order
ksort
Sort an array by key
list
Assign variables as if they were an array
natcasesort
Sort an array using a case insensitive "natural order" algorithm
natsort
Sort an array using a "natural order" algorithm
next
Advance the internal pointer of an array
pos
Alias of current
prev
Rewind the internal array pointer
range
Create an array containing a range of elements
reset
Set the internal pointer of an array to its first element
rsort
Sort an array in reverse order
shuffle
Shuffle an array
sizeof
Alias of count
sort
Sort an array
uasort
Sort an array with a user-defined comparison function and maintain index association
uksort
Sort an array by keys using a user-defined comparison function
usort
Sort an array by values using a user-defined comparison function
String Functions
addcslashes
Quote string with slashes in a C style
addslashes
Quote string with slashes
bin2hex
Convert binary data into hexadecimal representation
chop
Alias of rtrim
chr
Generate a single-byte string from a number
chunk_split
Split a string into smaller chunks
convert_cyr_string
Convert from one Cyrillic character set to another
convert_uudecode
Decode a uuencoded string
convert_uuencode
Uuencode a string
count_chars
Return information about characters used in a string
crc32
Calculates the crc32 polynomial of a string
crypt
One-way string hashing
echo
Output one or more strings
explode
Split a string by a string
fprintf
Write a formatted string to a stream
get_html_translation_table
Returns the translation table used by htmlspecialchars and htmlentities
hebrev
Convert logical Hebrew text to visual text
hebrevc
Convert logical Hebrew text to visual text with newline conversion
hex2bin
Decodes a hexadecimally encoded binary string
html_entity_decode
Convert HTML entities to their corresponding characters
htmlentities
Convert all applicable characters to HTML entities
htmlspecialchars_decode
Convert special HTML entities back to characters
htmlspecialchars
Convert special characters to HTML entities
implode
Join array elements with a string
join
Alias of implode
lcfirst
Make a string's first character lowercase
levenshtein
Calculate Levenshtein distance between two strings
localeconv
Get numeric formatting information
ltrim
Strip whitespace (or other characters) from the beginning of a string
md5_file
Calculates the md5 hash of a given file
md5
Calculate the md5 hash of a string
metaphone
Calculate the metaphone key of a string
money_format
Formats a number as a currency string
nl_langinfo
Query language and locale information
nl2br
Inserts HTML line breaks before all newlines in a string
number_format
Format a number with grouped thousands
ord
Convert the first byte of a string to a value between 0 and 255
parse_str
Parses the string into variables
print
Output a string
printf
Output a formatted string
quoted_printable_decode
Convert a quoted-printable string to an 8 bit string
quoted_printable_encode
Convert a 8 bit string to a quoted-printable string
quotemeta
Quote meta characters
rtrim
Strip whitespace (or other characters) from the end of a string
setlocale
Set locale information
sha1_file
Calculate the sha1 hash of a file
sha1
Calculate the sha1 hash of a string
similar_text
Calculate the similarity between two strings
soundex
Calculate the soundex key of a string
sprintf
Return a formatted string
sscanf
Parses input from a string according to a format
str_getcsv
Parse a CSV string into an array
str_ireplace
Case-insensitive version of str_replace
str_pad
Pad a string to a certain length with another string
str_repeat
Repeat a string
str_replace
Replace all occurrences of the search string with the replacement string
str_rot13
Perform the rot13 transform on a string
str_shuffle
Randomly shuffles a string
str_split
Convert a string to an array
str_word_count
Return information about words used in a string
strcasecmp
Binary safe case-insensitive string comparison
strchr
Alias of strstr
strcmp
Binary safe string comparison
strcoll
Locale based string comparison
strcspn
Find length of initial segment not matching mask
strip_tags
Strip HTML and PHP tags from a string
stripcslashes
Un-quote string quoted with addcslashes
stripos
Find the position of the first occurrence of a case-insensitive substring in a string
stripslashes
Un-quotes a quoted string
stristr
Case-insensitive strstr
strlen
Get string length
strnatcasecmp
Case insensitive string comparisons using a "natural order" algorithm
strnatcmp
String comparisons using a "natural order" algorithm
strncasecmp
Binary safe case-insensitive string comparison of the first n characters
strncmp
Binary safe string comparison of the first n characters
strpbrk
Search a string for any of a set of characters
strpos
Find the position of the first occurrence of a substring in a string
strrchr
Find the last occurrence of a character in a string
strrev
Reverse a string
strripos
Find the position of the last occurrence of a case-insensitive substring in a string
strrpos
Find the position of the last occurrence of a substring in a string
strspn
Finds the length of the initial segment of a string consisting entirely of characters contained within a given mask
strstr
Find the first occurrence of a string
strtok
Tokenize string
strtolower
Make a string lowercase
strtoupper
Make a string uppercase
strtr
Translate characters or replace substrings
substr_compare
Binary safe comparison of two strings from an offset, up to length characters
substr_count
Count the number of substring occurrences
substr_replace
Replace text within a portion of a string
substr
Return part of a string
trim
Strip whitespace (or other characters) from the beginning and end of a string
ucfirst
Make a string's first character uppercase
ucwords
Uppercase the first character of each word in a string
vfprintf
Write a formatted string to a stream
vprintf
Output a formatted string
vsprintf
Return a formatted string
wordwrap
Wraps a string to a given number of characters
Regular Expressions Functions
preg_filter
Perform a regular expression search and replace
preg_grep
Return array entries that match the pattern
preg_last_error
Returns the error code of the last PCRE regex execution
preg_match
Perform a regular expression match
preg_match_all
Perform a global regular expression match
preg_quote
Quote regular expression characters
preg_replace
Perform a regular expression search and replace
preg_split
Split string by a regular expression
ereg
Regular expression match
ereg_replace
Replace regular expression
Date/Time Functions
checkdate
Validate a Gregorian date
date_add
Alias of DateTime::add
date_create_from_format
Alias of DateTime::createFromFormat
date_create_immutable_from_format
Alias of DateTimeImmutable::createFromFormat
date_create_immutable
Alias of DateTimeImmutable::__construct
date_create
Alias of DateTime::__construct
date_date_set
Alias of DateTime::setDate
date_default_timezone_get
Gets the default timezone used by all date/time functions in a script
date_default_timezone_set
Sets the default timezone used by all date/time functions in a script
date_diff
Alias of DateTime::diff
date_format
Alias of DateTime::format
date_get_last_errors
Alias of DateTime::getLastErrors
date_interval_create_from_date_string
Alias of DateInterval::createFromDateString
date_interval_format
Alias of DateInterval::format
date_isodate_set
Alias of DateTime::setISODate
date_modify
Alias of DateTime::modify
date_offset_get
Alias of DateTime::getOffset
date_parse_from_format
Get info about given date formatted according to the specified format
date_parse
Returns associative array with detailed info about given date
date_sub
Alias of DateTime::sub
date_sun_info
Returns an array with information about sunset/sunrise and twilight begin/end
date_sunrise
Returns time of sunrise for a given day and location
date_sunset
Returns time of sunset for a given day and location
date_time_set
Alias of DateTime::setTime
date_timestamp_get
Alias of DateTime::getTimestamp
date_timestamp_set
Alias of DateTime::setTimestamp
date_timezone_get
Alias of DateTime::getTimezone
date_timezone_set
Alias of DateTime::setTimezone
date
Format a local time/date
getdate
Get date/time information
gettimeofday
Get current time
gmdate
Format a GMT/UTC date/time
gmmktime
Get Unix timestamp for a GMT date
gmstrftime
Format a GMT/UTC time/date according to locale settings
idate
Format a local time/date as integer
localtime
Get the local time
microtime
Return current Unix timestamp with microseconds
mktime
Get Unix timestamp for a date
strftime
Format a local time/date according to locale settings
strptime
Parse a time/date generated with strftime
strtotime
Parse about any English textual datetime description into a Unix timestamp
time
Return current Unix timestamp
timezone_abbreviations_list
Alias of DateTimeZone::listAbbreviations
timezone_identifiers_list
Alias of DateTimeZone::listIdentifiers
timezone_location_get
Alias of DateTimeZone::getLocation
timezone_name_from_abbr
Returns the timezone name from abbreviation
timezone_name_get
Alias of DateTimeZone::getName
timezone_offset_get
Alias of DateTimeZone::getOffset
timezone_open
Alias of DateTimeZone::__construct
timezone_transitions_get
Alias of DateTimeZone::getTransitions
timezone_version_get
Gets the version of the timezonedb
Filesystem Functions
clearstatcache
Clears file status cache
copy
Copies file
file_exists
Checks whether a file or directory exists
file_get_contents
Reads entire file into a string
file_put_contents
Write data to a file
fileatime
Gets last access time of file
filectime
Gets inode change time of file
filesize
Gets file size
file
Reads entire file into an array
fgets
Gets line from file pointer
fopen
Opens file or URL
fclose()
Closes an open file pointer
fgets()
Gets line from file pointer
fread()
Binary-safe file read
fwrite()
Binary-safe file write
filegroup
Gets file group
fileinode
Gets file inode
filemtime
Gets file modification time
fileowner
Gets file owner
fileperms
Gets file permissions
filetype
Gets file type
flock
Portable advisory file locking
fnmatch
Match filename against a pattern
fpassthru
Output all remaining data on a file pointer
fputcsv
Format line as CSV and write to file pointer
fputs
Alias of fwrite
fscanf
Parses input from a file according to a format
fseek
Seeks on a file pointer
fstat
Gets information about a file using an open file pointer
ftell
Returns the current position of the file read/write pointer
ftruncate
Truncates a file to a given length
fwrite
Binary-safe file write
glob
Find pathnames matching a pattern
is_dir
Tells whether the filename is a directory
is_executable
Tells whether the filename is executable
is_file
Tells whether the filename is a regular file
is_link
Tells whether the filename is a symbolic link
is_readable
Tells whether a file exists and is readable
is_uploaded_file
Tells whether the file was uploaded via HTTP POST
is_writable
Tells whether the filename is writable
is_writeable
Alias of is_writable
lchgrp
Changes group ownership of symlink
lchown
Changes user ownership of symlink
link
Create a hard link
linkinfo
Gets information about a link
lstat
Gives information about a file or symbolic link
mkdir
Makes directory
move_uploaded_file
Moves an uploaded file to a new location
parse_ini_file
Parse a configuration file
parse_ini_string
Parse a configuration string
pathinfo
Returns information about a file path
pclose
Closes process file pointer
popen
Opens process file pointer
readfile
Outputs a file
readlink
Returns the target of a symbolic link
realpath_cache_get
Get realpath cache entries
realpath_cache_size
Get realpath cache size
realpath
Returns canonicalized absolute pathname
rename
Renames a file or directory
rewind
Rewind the position of a file pointer
rmdir
Removes directory
set_file_buffer
Alias of stream_set_write_buffer
stat
Gives information about a file
symlink
Creates a symbolic link
tempnam
Create file with unique file name
tmpfile
Creates a temporary file
touch
Sets access and modification time of file
umask
Changes the current umask
unlink
Deletes a file
Regex syntax
^
Start of line
$
End of line
\A
Start of string
\z
End of string
.
Any single character
\s
Any whitespace character
\S
Any non-whitespace character
\d
Any digit
\D
Any non-digit
\w
Any word character (letter, number, underscore)
\W
Any non-word character
\b
Any word boundary character
\\
Escape character
a?
Zero or one of a
a*
Zero or more of a
a+
One or more of a
a{6}
Exactly 6 of a
a{6,}
6 or more of a
a{6,8}
Between 6 and 8 of a
(...)
Group section
(a|b)
a or b
[abc]
In range(a, b or c)
[^abc]
Any single character but a, b, or c
[a-z]
Any single character in the range a-z
[a-zA-Z]
any letter
[a-zA-Z0-9]
any alphanumeric
Pattern Modifiers
i
case-insensitive
m
multiple lines
s
a dot metacharacter in the pattern matches all characters, including newlines
x
whitespace and commentary are ignored
U
ungreedy mode
u
Pattern and subject strings are treated as UTF-8
Date Formatting
d
Day of the month(01 to 31)
D
Short week day name(Mon - Sun)
j
Day of the month(1 to 31)
l
Long week day name (Sunday - Saturday)
L
Long week day name (sunday - saturday)
w
the day of week (0-Sunday) to 6-Saturday)
z
The day of year (0 to 365)
W
ISO-8601 week number of year
F
Long month(January)
m
month(01 to 12)
M
Short month name(Jan)
n
month(1 through 12)
t
the days of month (28 to 31)
L
Whether it's a leap year 1 if it is a leap year, 0 otherwise.
o
ISO week number (W) Examples: 1999 or 2017
Y
4 digits year(2017)
y
2 digits year(17)
a
am or pm
A
AM or PM
B
Swatch Internet time(000 to 999)
g
12-hour(1 - 12)
G
24-hour(0 - 23)
h
12-hour(01 - 12)
H
24-hour(00 - 23)
i
Minutes(00 to 59)
s
Seconds(00 through 59)
u
Microseconds
v
Milliseconds
e
Timezone identifier (UTC, GMT, Atlantic/Azores)
I
daylight saving time(1 or 0)
O
Difference to GMT(+0200)
P
Difference to GMT(+02:00)
T
Timezone abbreviation(EST, MDT)
c
ISO 8601 date(2004-02-12T15:19:21+00:00)
r
RFC 2822 formatted date(Thu, 21 Dec 2000 16:01:07 +0200)
U
Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
MySQL Functions
mysql_affected_rows
Get number of affected rows in previous MySQL operation
mysql_client_encoding
Returns the name of the character set
mysql_close
Close MySQL connection
mysql_connect
Open a connection to a MySQL Server
mysql_create_db
Create a MySQL database
mysql_data_seek
Move internal result pointer
mysql_db_name
Retrieves database name from the call to mysql_list_dbs
mysql_db_query
Selects a database and executes a query on it
mysql_drop_db
Drop (delete) a MySQL database
mysql_errno
Returns the numerical value of the error message from previous MySQL operation
mysql_error
Returns the text of the error message from previous MySQL operation
mysql_escape_string
Escapes a string for use in a mysql_query
mysql_fetch_array
Fetch a result row as an associative array, a numeric array, or both
mysql_fetch_assoc
Fetch a result row as an associative array
mysql_fetch_field
Get column information from a result and return as an object
mysql_fetch_lengths
Get the length of each output in a result
mysql_fetch_object
Fetch a result row as an object
mysql_fetch_row
Get a result row as an enumerated array
mysql_field_flags
Get the flags associated with the specified field in a result
mysql_field_len
Returns the length of the specified field
mysql_field_name
Get the name of the specified field in a result
mysql_field_seek
Set result pointer to a specified field offset
mysql_field_table
Get name of the table the specified field is in
mysql_field_type
Get the type of the specified field in a result
mysql_free_result
Free result memory
mysql_get_client_info
Get MySQL client info
mysql_get_host_info
Get MySQL host info
mysql_get_proto_info
Get MySQL protocol info
mysql_get_server_info
Get MySQL server info
mysql_info
Get information about the most recent query
mysql_insert_id
Get the ID generated in the last query
mysql_list_dbs
List databases available on a MySQL server
mysql_list_fields
List MySQL table fields
mysql_list_processes
List MySQL processes
mysql_list_tables
List tables in a MySQL database
mysql_num_fields
Get number of fields in result
mysql_num_rows
Get number of rows in result
mysql_pconnect
Open a persistent connection to a MySQL server
mysql_ping
Ping a server connection or reconnect if there is no connection
mysql_query
Send a MySQL query
mysql_real_escape_string
Escapes special characters in a string for use in an SQL statement
mysql_result
Get result data
mysql_select_db
Select a MySQL database
mysql_set_charset
Sets the client character set
mysql_stat
Get current system status
mysql_tablename
Get table name of field
mysql_thread_id
Return the current thread ID
mysql_unbuffered_query
Send an SQL query to MySQL without fetching and buffering the result rows
Math Functions
abs
Absolute value
acos
Arc cosine
acosh
Inverse hyperbolic cosine
asin
Arc sine
asinh
Inverse hyperbolic sine
atan2
Arc tangent of two variables
atan
Arc tangent
atanh
Inverse hyperbolic tangent
base_convert
Convert a number between arbitrary bases
bindec
Binary to decimal
ceil
Round fractions up
cos
Cosine
cosh
Hyperbolic cosine
decbin
Decimal to binary
dechex
Decimal to hexadecimal
decoct
Decimal to octal
deg2rad
Converts the number in degrees to the radian equivalent
exp
Calculates the exponent of e
expm1
Returns exp(number) - 1, computed in a way that is accurate even when the value of number is close to zero
floor
Round fractions down
fmod
Returns the floating point remainder (modulo) of the division of the arguments
getrandmax
Show largest possible random value
hexdec
Hexadecimal to decimal
hypot
Calculate the length of the hypotenuse of a right-angle triangle
intdiv
Integer division
is_finite
Finds whether a value is a legal finite number
is_infinite
Finds whether a value is infinite
is_nan
Finds whether a value is not a number
lcg_value
Combined linear congruential generator
log10
Base-10 logarithm
log1p
Returns log(1 + number), computed in a way that is accurate even when the value of number is close to zero
log
Natural logarithm
max
Find highest value
min
Find lowest value
mt_getrandmax
Show largest possible random value
mt_rand
Generate a random value via the Mersenne Twister Random Number Generator
mt_srand
Seeds the Mersenne Twister Random Number Generator
octdec
Octal to decimal
pi
Get value of pi
pow
Exponential expression
rad2deg
Converts the radian number to the equivalent number in degrees
rand
Generate a random integer
round
Rounds a float
sin
Sine
sinh
Hyperbolic sine
sqrt
Square root
srand
Seed the random number generator
tan
Tangent
tanh
Hyperbolic tangent
Network Functions
checkdnsrr
Check DNS records corresponding to a given Internet host name or IP address
closelog
Close connection to system logger
define_syslog_variables
Initializes all syslog related variables
dns_check_record
Alias of checkdnsrr
dns_get_mx
Alias of getmxrr
dns_get_record
Fetch DNS Resource Records associated with a hostname
fsockopen
Open Internet or Unix domain socket connection
gethostbyaddr
Get the Internet host name corresponding to a given IP address
gethostbyname
Get the IPv4 address corresponding to a given Internet host name
gethostbynamel
Get a list of IPv4 addresses corresponding to a given Internet host name
gethostname
Gets the host name
getmxrr
Get MX records corresponding to a given Internet host name
getprotobyname
Get protocol number associated with protocol name
getprotobynumber
Get protocol name associated with protocol number
getservbyname
Get port number associated with an Internet service and protocol
getservbyport
Get Internet service which corresponds to port and protocol
header_register_callback
Call a header function
header_remove
Remove previously set headers
header
Send a raw HTTP header
headers_list
Returns a list of response headers sent (or ready to send)
headers_sent
Checks if or where headers have been sent
http_response_code
Get or Set the HTTP response code
inet_ntop
Converts a packed internet address to a human readable representation
inet_pton
Converts a human readable IP address to its packed in_addr representation
ip2long
Converts a string containing an (IPv4) Internet Protocol dotted address into a long integer
long2ip
Converts an long integer address into a string in (IPv4) Internet standard dotted format
openlog
Open connection to system logger
pfsockopen
Open persistent Internet or Unix domain socket connection
setcookie
Send a cookie
setrawcookie
Send a cookie without urlencoding the cookie value
socket_get_status
Alias of stream_get_meta_data
socket_set_blocking
Alias of stream_set_blocking
socket_set_timeout
Alias of stream_set_timeout
syslog
Generate a system log message
Control Structures
else
elseif/else if
Alternative syntax for control structures
while
do-while
for
foreach
break
continue
declare
return
require
include
require_once
include_once
goto