PHP 101 course image

PHP 101

This course is a complete beginner's guide to learning PHP syntax, variables, functions, classes & more. Created in 2022 and based on the newest version, PHP 8!

47 lessons

2h 10m

Mark Shust

The PHP language keeps aging like a fine bottle of wine. With every new release, the language that runs the web keeps getting faster & stronger. Community support is increasing, and platforms such as Laravel & Magento offer enterprise features. There has never been a better time to learn PHP.

In this course, you will learn all about PHP 8's syntax & new features. You'll also learn how to create variables, functions & classes. You may even pick up tidbits & tricks that I've learned along the way as my over 20 years as a PHP programmer.

Course curriculum

Each video lesson can be played back & referenced as many times as you wish at slow or fast speed, tech-friendly closed captions, and includes full source code.

Includes English captions, and Spanish translations provided by Google Translate

47 lessons

2h 10m

Recently released July 15, 2022

Project Setup

Install PHP with Homebrew
Install PHP with Homebrew
Install a PHP IDE editor
Install a PHP IDE editor
Start the built-in PHP web server
Start the built-in PHP web server

PHP Tags

Create a “Hello world!” PHP script
Create a “Hello world!” PHP script
Closing tags, semicolons & line breaks in PHP
Closing tags, semicolons & line breaks in PHP
Alternate method of calling PHP language constructs
Alternate method of calling PHP language constructs
Write short echo tags in PHP
Write short echo tags in PHP

Variables & Constants

Create & name variables in PHP
Create & name variables in PHP
PHP data type assignments
PHP data type assignments
Type casting in PHP
Type casting in PHP
Type juggling (coercion) in PHP
Type juggling (coercion) in PHP
Concatenating strings in PHP
Concatenating strings in PHP
String interpolation & escaping in PHP
String interpolation & escaping in PHP
Create a constant in PHP to store a fixed value
Create a constant in PHP to store a fixed value
Create a Boolean variable in PHP
Create a Boolean variable in PHP

Conditionals

Conditionally execute PHP code with an if statement
Conditionally execute PHP code with an if statement
Write multiple conditions to execute alternate PHP code
Write multiple conditions to execute alternate PHP code
Alternate PHP if statement syntax for view files
Alternate PHP if statement syntax for view files
Refactor a PHP if else statement into a ternary
Refactor a PHP if else statement into a ternary
Use a PHP switch statement for advanced conditional logic
Use a PHP switch statement for advanced conditional logic
Use a match statement for advanced PHP data checks
Use a match statement for advanced PHP data checks

Arrays & Loops

Create a list using a PHP array
Create a list using a PHP array
Display the contents of an array with a foreach loop
Display the contents of an array with a foreach loop
Use an array key to determine current iteration
Use an array key to determine current iteration
Create a key:value store within a PHP array
Create a key:value store within a PHP array
Create a nested or multi-dimensional array in PHP
Create a nested or multi-dimensional array in PHP
Get the count of a PHP array
Get the count of a PHP array
5070. Display the contents of an array with a for loop
5070. Display the contents of an array with a for loop
Continue or break out of a PHP loop
Continue or break out of a PHP loop

Functions

Purpose of a function in PHP
Purpose of a function in PHP
Create a function in PHP
Create a function in PHP
Function & global scope in PHP
Function & global scope in PHP
Calling functions with return values in PHP
Calling functions with return values in PHP
Passing arguments to PHP functions
Passing arguments to PHP functions
Defining function return & argument types in PHP
Defining function return & argument types in PHP
Type coercion & strict data types in PHP
Type coercion & strict data types in PHP
Including or requiring files in PHP
Including or requiring files in PHP

Classes

Create & instantiate a class in PHP
Create & instantiate a class in PHP
Run code on PHP class creation with a constructor
Run code on PHP class creation with a constructor
Create class properties in previous versions of PHP
Create class properties in previous versions of PHP
Create promoted properties in PHP 8 classes
Create promoted properties in PHP 8 classes
Retrieve public class properties with PHP’s arrow syntax
Retrieve public class properties with PHP’s arrow syntax
Understanding scope in PHP classes
Understanding scope in PHP classes
Refactoring functions into PHP classes
Refactoring functions into PHP classes
Defining & using PHP namespaces
Defining & using PHP namespaces
Replace PHP require statements with the Composer class autoloader
Replace PHP require statements with the Composer class autoloader

Enroll in this course for free

Access all of the free courses in the M.academy Library.

Join now

Do you want to access the M.academy Library? Track course progress and automatically access new lessons. It’s also completely free 😁.

What's included

  • Track course progress

  • Automatically access new lessons

Completely free

$ 0

Frequently asked questions

Who is this course meant for?
This course was designed for everyone new to PHP programming. Some experience programming in other languages may help you out, but is definitely not required.
What do I need to know to take this course?
Some basic knowledge of programming is recommend, but not required.
What is very much required is the desire to learn, and keep trying when you are ready to give up!
Do I need a development environment setup?
No. This course assumes you are running a Mac, but will also work seamlessly for those running Windows & Linux. As long as you can install PHP on your system, ...that's all you need.
What version of PHP is this based on?
This course was created for and based on PHP 8.1. It is up to date with new features & functionality created in 2022.