Foundations
PHP · Beginner - the basics, step by step
- PHP and the server: your first scriptDiscover what PHP is, start the built-in server with php -S, write your first script with echo, and mix PHP and HTML.
- Variables, types, and stringsLearn how to store values in variables, tell the basic types apart, and put text together through concatenation or interpolation.
- Conditions and loopsMake your scripts react with if and match, then repeat actions with for, foreach, and while.
- Arrays: lists and key-value pairsStore several values in indexed or associative arrays and manipulate them with PHP’s essential functions.
- Functions: declare, type, returnCreate your own functions with typed parameters, default values, and return values.