PHP basics
Your first program, variables and types, and working with text.
About 4 hours of study
Learning objectives
- Write and run a PHP program
- Choose and convert types
- Handle text with string functions
Lessons
- 1
Your first PHP program
How a PHP file is laid out, printing with echo, print and printf, and the difference between single and double quotes.
- 2
Variables and types
Variables, the types int, float, string, bool and null, type conversion with casts, division and constants.
- 3
Strings
Joining text with the dot, trimming, searching, cutting and changing strings with the most useful functions.
Module practice
- PHP: A greeting cardEasy
- PHP: One receipt lineMedium
- PHP: Text in a boxHard
- PHP: Area and perimeterEasy
- PHP: Celsius to FahrenheitMedium
- PHP: Seconds to a clockHard
- PHP: Tidy a nameEasy
- PHP: Vowels and consonantsMedium
- PHP: PalindromesHard