
Set up a PHP sandbox to practice fundamentals and syntax, explore data types, functions, loops, and super globals, and work with starter and finished code for a vanilla PHP project.
Master PHP variables as containers for data, including strings, integers, and booleans, and learn dollar-prefixed naming rules, case sensitivity, and conventions like underscores, camelCase, and PascalCase.
Learn how to concatenate strings in PHP using the period operator, compare single vs double quotes, interpolate versus concatenation, and escape characters to output variables like a full name.
Explore how PHP performs implicit type casting (type juggling) and explicit type casting, converting integers, strings, booleans, and null, with practical examples on arithmetic and concatenation.
Apply basic PHP concepts by creating variables for title, author, body, and page title, then display a blog post using concatenation or interpolation, with proper escaping.
Master PHP arithmetic operators—addition, subtraction, multiplication, division, and modulus—and assignment operators, plus built-in math functions like rand, round, ceil, floor, sqrt, pi, abs, max, min, and number_format.
Explore PHP string functions, from string length and word count to position, substrings, and replacements; apply string to lower, string to upper, U.S. words, and trim for clean text.
Explore using the PHP date function to extract year, month, day, and time components from timestamp dates, with formats like Y, m, d, D, L, i, s, a, and str_to_time.
Explore arrays in PHP from scratch, covering zero-based indexing, dynamic sizing, and mixed data types, with creation via array() and brackets, plus debugging basics like vardump and print_r.
Explore PHP array functions to manipulate arrays. Learn count, sort, push, pop, shift, unshift, slice, splice, sum, search, in_array, explode, and implode.
Learn associative arrays in PHP, storing key-value pairs with string or numeric keys and any value type; create, access, nest, add, and unset elements, including multidimensional arrays for database results.
Explore basic loops in PHP, including for, while, and do-while, with initialization, condition, and update concepts, and learn echoing output and looping over arrays and nested loops.
Explore nested loops in PHP by building a 5x5 css grid with a nested for loop, and a nested while loop using outer i and inner j.
Explore looping through arrays in PHP, using for loops with count and indices, and display names and associative arrays with for each, including keys and values, to build output lists.
Learn to render dynamic job cards by iterating over a PHP array with a foreach loop, outputting title, description, salary, location, and comma-separated tags using implode.
Explore control flow in PHP through basic if statements, including if, else, and nested structures, using age-based conditions to demonstrate drink and vote logic.
Learn to implement conditional HTML output in a PHP HTML template using if statements with shorthand syntax, manage login state using is_logged_in, and display welcome messages or log in prompts.
Compare values with PHP's comparison operators and logical operators, including equal, identical, not equal, not identical, and, or, exclusive or (xor), and not, with practical examples.
Explore how conditionals and loops work in PHP, using while and for loops to control flow with break and continue, including examples of checking even numbers with the modulus operator.
Practice dynamic PHP rendering of a job listings page by looping through listings, coloring even items blue, and showing a local badge for New York while hiding empty tags.
Explore PHP switch statements to map the current day of the week to specific messages and colors, replacing long if-else chains with clean case-based logic in a live HTML example.
Learn to use the ternary operator in PHP as a shorthand for if-else to produce compact html output with templates and refactor examples for cards, badges, and tags.
Explore the PHP null coalescing operator to provide fallback values, simplifying ternary logic from blue to other fallbacks in your code.
Loop through a names array using for each or a traditional for loop, skip names starting with a, and reverse and lowercase the remaining names, printing them with line breaks.
Learn how to define and call functions to reuse code, call them multiple times, pass parameters, and work with return values that can be stored or echoed.
Define functions with parameters in PHP, distinguish parameters from arguments, use default values, and apply the splat (rest) operator to accept multiple inputs and return their total.
Explore how global and local scope govern variable visibility in PHP, including how to pass names as parameters, use global, and encapsulate functions to avoid outside side effects.
Explore optional strict types in PHP by enabling declare(strict_types=1), enforcing int, string, and void type hints in functions to make code more robust and error-free.
Build useful PHP functions to format salaries with a dollar sign and commas, and highlight specific job tags with a yellow span, applying them to job listings.
Create a function to calculate the average salary from job listings, using loops or array helpers like array_column and array_sum, then format and display the result.
Explore anonymous functions in PHP, create closures with the function keyword and use keyword to access outer scope, and implement callbacks and counters.
Master PHP 7.4 arrow functions, a concise anonymous lambda syntax using fn and the fat arrow => for one liner helpers and callbacks like array_map.
Tackle PHP function challenges from scratch: fahrenheit to celsius with named, anonymous, and closure forms; temp 32 and use keyword; print uppercase names and find the longest word with explode.
Explore the fundamentals of object oriented programming (OOP) with objects, classes, and blueprints, covering inheritance, encapsulation, polymorphism, and abstraction, and see how these concepts enable modular, reusable PHP code.
Learn to create a PHP class as a blueprint for a user object, define public properties name and email, add a login method, and instantiate with a constructor.
Explore public, protected, and private modifiers that control visibility, and how getters and setters expose private properties within a class, including defaults and inheritance.
Learn to use static properties and methods in PHP via the class name and scope resolution operator, illustrated with a math utility class for pi and sum.
Explain abstract classes as templates with abstract and concrete methods, show a shape base class with a protected name, can't be instantiated, and illustrate circle and rectangle subclasses implementing calculate_area.
Explore interfaces as contracts that declare display and edit methods, implemented by article and video classes, demonstrating polymorphism and consistent content management behavior.
Understand PHP super globals, nine global associative arrays accessible from anywhere in a script, including server, get, post, files, cookie, session, request, and env, with usage and security considerations.
Learn how to access server information in PHP with the $_SERVER superglobal, including request method, server name, protocol, document root, and user agent.
Set and retrieve environment variables with put env and get env in PHP, then use the $GLOBALS super global to access variables across scope.
Explore how the get superglobal retrieves query parameters from the URL, and access them safely with is set or null coalescing. Filter listings by location using array_filter and case-insensitive checks.
Use PHP's post superglobal to receive form data, safeguard inputs with html special chars to prevent XSS, and display submitted title and description after a post submission.
Explore how the $_REQUEST superglobal retrieves query params and post data, and learn why using get or post is preferred for security, predictability, and readability.
Learn to use the PHP $_FILES superglobal to upload a file from a logo input, create an uploads directory, generate a unique file name, and move the file.
Learn how PHP sessions use the session superglobal to persist user data on the server across requests via a session ID cookie, and how to start and destroy sessions.
Explore how to create, read, and delete cookies with PHP using the $_COOKIE superglobal, including expiration, path, http only, and client-side versus server-side storage concepts.
Install MySQL on macOS with Homebrew, start the service, secure the root account, and log in to show databases from the command line.
Learn how to set up MySQL on Windows using Larrigan or alternatives like Zamp or MAMP, connect via GUI or terminal, view databases, and prepare for basic SQL statements.
Here is the link to the cheat sheet:
https://gist.github.com/bradtraversy/c831baaad44343cc945e76c2e30927b3
Explore MySQL Workbench, a free cross-platform GUI, to set up a blog schema and a posts table with id, title, body, and created_at using current_timestamp and primary key.
Learn how to connect PHP to a blog database using PDO, build a DSN with host, port, and db name, pass credentials, enable exception handling, and verify the connection.
Fetch a single post by id from the URL using the get superglobal and display its title and body with a prepared PDO statement and placeholders.
Delete posts in a PHP app by spoofing delete request with a hidden _method in a post form, passing the post id to delete.php, and using PDO with prepared statements.
Set up the main php project folder on Windows or Mac, create an index.php that echoes hello world, and run the php dev server on port 8000 to view it.
Learn how to structure a PHP project with controllers and views, set a public folder as document root, and use a base_path helper to include views and assets efficiently.
Initialize a git repository and create a .gitignore to exclude vendor, node_modules, env, and dsstore. Add, commit, and push changes to the main branch on GitHub.
Learn to split the user interface into partials by creating a partials folder and using load view and load partial helpers to render head, nav, showcase, and banners in PHP.
Create and use PHP inspect helper functions to debug variables with vardump inside pre tags, including inspect and die, and apply these patterns to routing and middleware.
Create a basic PHP router that maps URLs to controllers via a routes array in index.php, with a 404 error handler and htaccess rewrite for Apache.
Create and organize views for routes and controllers, using load view and shorthand syntax to build listings index and create pages, and test with a 404 error page.
Separate router files organize routes and router logic in PHP, with routes.php containing routes and router.php handling requests, fixing the logo to home, restful routing with get, post, put, delete.
Refactor the router into a class and add get, post, put, and delete methods. Map uris to controllers, load views, and handle 404 errors with an error method.
Learn to connect to a MySQL database with PDO, build a basic database class with a query method, and pass data to views for display in a layout.
Set up a MySQL database and schema named Work Opia with MySQL Workbench, create listings and users tables with a foreign key, and populate sample data for testing.
Learn to pass listings data from the controller to the view using an array, extract to variables, and iterate with foreach to render dynamic job listings.
Explore building a single listing detail page in PHP, using a query string ID, RESTful show convention, and safe prepared statements with named parameters.
Fetch a single listing by id from the query string and display its title, description, salary, location, requirements, benefits, and contact email in a clean, object-oriented PHP view.
This course is broken up into two parts. First, we have seven learning modules to learn the fundamentals of PHP programming, including:
Data Types & Variables
Arrays & Iteration
Control Structures & Conditionals
Functions & Scope
Object Oriented Programming
Superglobals ($_GET, $_POST, $_SESSION, $_COOKIES, etc)
Database Integration & PDO
After that, we go for a hands-on approach and build a job listing website. We build this from the ground up without any framework or libraries. These sections will teach you how to structure a vanilla PHP project and is a great precursor to learning Laravel or another framework.
Here is what we will do in the project videos:
We will create a custom Laravel-like router. We will refactor this a bunch of times to keep adding features like accepting HTTP methods, params and middleware.
We will structure our project into two main folders, which will be called Framework and App. Framework will be the core that includes classes like Router, Database, Validation, and Session. App will include our controllers and views.
We will create CRUD operations for job listings.
We will implement an authentication and authorization system as well as protect routes using custom middleware.
We will add a search feature to search/filter listings by keywords and/or location
We will learn to validate and sanitize data as well as use prepared statements with PDO to protect against SQL injection attacks.
If you are a beginner, I suggest taking the course from the beginning and go through all of the learning modules. If you are more experienced and know the fundamentals, you can jump right into the project.