Code Snippets

PHP: redirect a user to another page
PHP: sorting arrays
PHP: command line calendar
JavaScript: get string length
PHP: generate a random number
JavaScript: check whether an integer is odd or even
PHP: check whether an integer is odd or even
PHP: highlight alternate rows in HTML output
PHP: convert a string into upper case letters
PHP: convert a string into lower case letters
PHP: get subdomain from host
PHP: get user's IP address
PHP: check page is being accessed via SSL/TLS
PHP: get IP address of the server
PHP: foreach loop
PHP: add optional parameters to a function
PHP: create a static method
PHP: check array contains a value
PHP: try catch block
Linux: open vim with the cursor positioned at the end of the file
Linux: substitute user with su command
Linux: read a man page
Linux: extract specific directory or file from bzipped TAR archive
PHP: check year is in YYYY format using regular expression
PHP: for loop
PHP: get array length
PHP: create an array
PHP: get string length
PHP: define a constant
PHP: send an email