When array_shift() is called on an array, all numerical array keys are modified to start from 0 and literal keys are untouched.
session fixation - a commonly used session-based attack, can be prevented simply by giving a user a new Session ID whenever they obtain a new level of permission on a site (for instance, after they successfully log in).
session_regenerate_id is the function used to change the ID for an active session.
number_format() is not locale-aware. It will use commas for thousands and periods for decimals unless you indicate otherwise in the function call.
When using PDO, errorCode() returns the SQLSTATE associated with the last database operation.
By default PHP stores its session on the web server's filesystem. To tell PHP to use your custom session storage handler, you should use session_set_save_handler()
When performing SQL operations within a transaction, ROLLBACK is used to end the transaction and undo all of the changes made since the transaction was started.
when sorting a data set in an SQL query with ORDER BY, the default direction is ASC if none is specified.
HTTP code 403 indicates "Forbidden"
HTTP code 301 indicates "Moved Permanently"
in_array() is used to return true if a given value exists in an array and false if it doesn't.
tempnam generates a file resource having 0600 file permission in the file system with a randomly generated filename to be used as temporary storage.
fgetss() would be used if you want to retrieve only the texts from an HTML file and leave all HTML and PHP tags.
stream_set_timeout() can be used to alter the amount of time PHP waits for a stream before timing out during reading or writing.
ftell() can be used to indicate the current position of the file read/write pointer.
session_destroy() can be used to destroy session variables within a PHP session.
urlencode() is used to encode a URL.
You cannot delete a cookie from a client computer.
setcookie() is used to set a cookie to be sent along with the rest of the HTTP headers.
session.use_trans_sid is the PHP.ini to use if you want to allow PHP to dynamically choose whether to propagate the session identifier via cookies or the URL, depending on the user's preferences.
setrawcookie() is used to send an HTTP cookie without URL encoding the cookie value.
!in_array("Location: $url", headers_list()), can be used to check whether the header has already been sent or not.
For queries that use an outer join between two tables, the OR and IN operators are not allowed in the query.
An outer join retrieves all rows from one table and only matching rows from the joined table.
A GROUP BY clause returns a single row of information for each group of rows.
PDOStatement->nextRowset() returns the next result set in a multi-query statement.
\s is a metacharacter in PCRE to match any whitespace character
explode(), and preg_split() can be used to break a string into an array based on a specific pattern.
strcasecmp() can be used to compare two strings using a case-insensitive binary algorithm.
strcmp() for case-sensitive comparison.
\W is a PCRE metacharacter used to find a non-word character
strtok() can be used to parse a string according to \t and \n characters.
time() function is used to return the current time measured in the number of seconds since the UNIX Epoch (Jan 1, 1970, 00:00:00 GMT)
dom_import_simplexml() is used to import SimpleXML objects for use with DOM
json_decode() is used to decode a json encoded string/array.
__getLastRequestHeaders() and __getLastRequest() are used by the SOAP client to debug messages sent to and received from a SOAP server.
xml_set_element_handler() sets up start and end element handlers.
echo strtotime("january 1, 1901"); // will output FALSE if older versions of glibc are present in the operating system.
escapeshellarg(), escapeshellcmd() can be used as a countermeasure to a Shell Injection attack.
mysql_real_escape_string() can be used to escape all special character from a string before submitting to a database. It can also be used as a countermeasure against a SQL injection attack.
md5() is the best choice to retrieve the fingerprint of a string.
use the session_set_save_handler() function if you want to save a client's session values in a database.
The ActiveRecord design pattern is used to encapsulate a data source so that accessing data source components becomes hidden within the class that implements the pattern.
__toString() is used to directly echo or print an object.
The instanceof operator lets a programmer inspect all of the ancestor classes of the object, as well as any interfaces.
strtotime() and time() return a timestamp value.