PHP Lessons
Master server-side logic and Laravel patterns. Build dynamic, data-driven web applications with speed and precision.
Hello World
Write your first PHP script using echo.
Comments
Learn how to leave notes in your code with comments.
Variables
Variables in PHP always start with a dollar sign $.
Strings
Work with text using single or double quotes.
Numbers
PHP handles integers and floats naturally.
Arrays Indexed
Store multiple values in a list.
Arrays Assoc
Key-value pairs allow named items.
Concatenation
Join strings together using the dot operator.
Constants
Constants never change value.
Basic Math
Perform calculations with math operators.
If Statements
Make decisions in your code.
Else Elseif
Handle multiple conditions.
Switch
Switch between many possible values.
Match
The modern way to switch values (PHP 8+).
While Loop
Repeat code while a condition is true.
For Loop
Loop a specific number of times.
Foreach Loop
Iterate over arrays easily.
Functions
Reuse code with functions.
Parameters
Pass data into functions.
Return Values
Get results back from a function.
Scope
Understanding variable visibility.
Type Declarations
Enforce types for better code quality.
Classes
Object Oriented Programming starts with Classes.
Properties
Add data to your classes.
Methods
Add behavior to your classes.
Constructors
Run code when an object is created.
Static
Access members without creating an object.
Inheritance
Share functionality between classes.
Interfaces
Define a contract for classes.
Namespace
Organize your code.