PHP tutorial
Learn server-side web programming basics.
14 lessonsExamples and guided walkthroughs
Course contents
Programming fundamentals
010203040506
PHP Basics
Print a value from a PHP script.
PHP Arrays
Loop through an indexed array.
PHP Functions
Declare typed parameters and return values.
PHP strings, sprintf, and regular expressions
Format text with sprintf, split and join strings, and match patterns with preg functions.
PHP strict types, match, and the nullsafe operator
Use union types, a match expression, constructor promotion, and ?-> to write safer code.
PHP closures, array functions, and generators
Transform arrays with map, filter, and reduce, capture variables in closures, and produce values lazily with yield.
Object-oriented programming
Data structures and algorithms
091011
PHP Associative Arrays
Map names to values and loop over keys and values.
PHP sorting, usort, and the spaceship operator
Sort arrays by value or by custom rules, and combine several sort keys with <=>.
PHP SPL data structures: stack, queue, and heap
Use the standard SplStack, SplQueue, SplMinHeap, and SplPriorityQueue classes.