Learn PHP

If you want to be a web developer, you need to learn PHP. Read these free tutorials to master this powerful and popular scripting language.

Getting started with PHP

  • How to Build a Simple REST API in PHP

    How to Build a Simple REST API in PHP

    Sajal Soni
  • How to Use Sessions and Session Variables in PHP

    How to Use Sessions and Session Variables in PHP

    Sajal Soni
  • How to Upload a File in PHP (With an Example)

    How to Upload a File in PHP (With an Example)

    Sajal Soni
  • All PHP content:

    1. Read a CSV to an Array in PHP

      Read a CSV to an Array in PHP

      Tutorial Beginner

      In this post, I'll show you how to use PHP's built-in functions to read and print the contents of a CSV file and convert it into an array.

    2. How to Use Yield and Generators in PHP

      How to Use Yield and Generators in PHP

      Tutorial Intermediate

      This tutorial will teach you how to use yield and generators in PHP. We will start with the basics and then move on to topics like generator delegation.

    3. PHP Exceptions: Try Catch for Error Handling

      PHP Exceptions: Try Catch for Error Handling

      Tutorial Beginner

      In this post, you'll learn how to use exception handling in PHP. As of PHP 5, we can use try catch blocks for error handling—this is a better way to handle...

    4. Get Command-Line Arguments With PHP $argv or getopt()

      Get Command-Line Arguments With PHP $argv or getopt()

      Tutorial Intermediate

      In this tutorial, you will learn how to access command-line arguments inside your script with $argv and getopt() in PHP.

    5. PHP Type Casting: A Complete Guide

      PHP Type Casting: A Complete Guide

      Tutorial Beginner

      This tutorial will help you learn the basics of type casting in PHP. We will learn about allowed cast types and the rules followed for such castings.

    6. Functional Programming in PHP With Lambda Functions

      Functional Programming in PHP With Lambda Functions

      Tutorial Intermediate

      One of the nice things about programming is that the same problem can be solved using multiple methods. This tutorial will teach you how to use functional...

    7. Comparing the 5 Best PHP Form Builders (And 3 Free Scripts)

      Comparing the 5 Best PHP Form Builders (And 3 Free Scripts)

      Tutorial Beginner

      Looking for a PHP form builder script for your website? Today, we compare the five best PHP form generators available at CodeCanyon. This post will help you...

    8. How to Use AJAX in PHP and jQuery

      How to Use AJAX in PHP and jQuery

      Tutorial Beginner

      Today, we’re going to explore the concept of AJAX with PHP. The AJAX technique helps you to improve your application's user interface and enhance the overall...

    9. Understanding Static Functions and Static Classes in PHP

      Understanding Static Functions and Static Classes in PHP

      Tutorial Beginner

      Static functions and static classes can be easily accessed without necessarily creating an instance of that class. This helps keep your code clean and...

    10. Get Started With Laravel 8

      Get Started With Laravel 8

      Course Beginner

      Laravel is an easy-to-learn framework for building web applications. It has become hands-down the most popular framework for writing apps with PHP. Now that...

    11. How to Use parse_str in PHP

      How to Use parse_str in PHP

      Tutorial Beginner

      In this article, we’ll explore the parse_str function in PHP. It’s used to convert a GET request query string into variables.

    12. PHP Fundamentals

      PHP Fundamentals

      Course Beginner

      Learn the fundamentals of PHP and object-oriented programming in this free PHP tutorial. Jeremy McPeak will help you learn PHP and use it to write web apps. ...