PHP Cheat Sheet by DaveChild
A quick reference guide for PHP, with functions references, a regular expression syntax guide and a reference for PHP's date formating functions. As of 28/6/14, the cheat sheet now includes popup links to the appropriate PHP manual pages.
php development lamp programming web
PHP Array Functions
PHP String Functions
PHP Filesystem Functions
PHP Regular Expressions Functions
Regular Expressions Syntax
There's an excellent regular expression tester at: http://regexpal.com/
* PCRE modifier
PHP fopen() Modes
PHP Date Formatting
¹ 0 is Sunday, 6 is Saturday.
² Week that overlaps two years belongs to year that contains most days of that week. Hence week number for 1st January of a given year can be 53 if week belongs to previous year. date("W", mktime(0, 0, 0, 12, 8, $year)) always gives correct number of weeks in $year.
³ The Epoch is the 1st January 1970.
⁴ With leading zeroes
Download the PHP Cheat Sheet
Share This Cheat Sheet!
Like this cheat sheet? Check out our favourite related books!
Head First PHP & MySQL
"Heads First PHP and MySQL is a great beginners book, one that should be on the bookshelf of every up and coming PHP developer."
PHP & MySQL: Novice to Ninja
"Quite honestly, this book PHP & MySQL: Novice to Ninja went beyond my expectations. Overall Rating: Great Book!!"
PHP Objects, Patterns, and Practice
"This is an amazing book. I made the switch to OO PHP about a year ago, and I am learning something new every time I open this book."