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 tutorials:

    1. How to Check if a String Contains Another Substring in PHP

      How to Check if a String Contains Another Substring in PHP

      Tutorial Beginner

      In this quick tip, we will go over multiple methods to determine if a string contains another substring in PHP.

    2. Example of How to Add Google reCAPTCHA v3 to a PHP Form

      Example of How to Add Google reCAPTCHA v3 to a PHP Form

      Tutorial Beginner

      Learn how to add Google reCAPTCHA v3 to a form on your PHP website. The latest reCAPTCHA is different than the previous versions—it doesn’t require user...

    3. 12 Best PHP Chat Scripts on CodeCanyon

      12 Best PHP Chat Scripts on CodeCanyon

      Tutorial Beginner

      If you want to add live chat to your website, you can use a PHP chat script. You can take your customer support to the next level by purchasing an online...

    4. How to Call a PHP Function From JavaScript

      How to Call a PHP Function From JavaScript

      Tutorial Beginner

      In this tutorial, I'll teach you how to call a PHP function from JavaScript using jQuery AJAX and the Fetch API. You will also learn how to call JavaScript...

    5. Functions in PHP: Return Values and Parameters

      Functions in PHP: Return Values and Parameters

      Tutorial Beginner

      This tutorial will teach you how to create your own user-defined functions in PHP. You will learn about return values from a function and function parameters...

    6. How to Work With Cookies in PHP

      How to Work With Cookies in PHP

      Tutorial Beginner

      You might have heard about cookies, but what exactly are they, and what can we do with them? In this tutorial, we will focus on the basics of cookies, and...

    7. How to Use Sessions and Session Variables in PHP

      How to Use Sessions and Session Variables in PHP

      Tutorial Beginner

      Sessions allow user information to be persisted across all the pages of a website or app. In this post, you'll learn the basics of session handling in PHP:...

    8. String Concatenation in PHP

      String Concatenation in PHP

      Tutorial Beginner

      In this quick tip, I'll teach you string concatenation in PHP. You'll learn how to prepend or append strings in PHP and how to concatenate strings together...

    9. How to Trim Strings in PHP

      How to Trim Strings in PHP

      Tutorial Beginner

      This quick tip will teach you how to trim strings in PHP from the left, right, or both ends at once. You will learn two different ways of doing it based on...

    10. How to Create a Thumbnail Image in PHP

      How to Create a Thumbnail Image in PHP

      Tutorial Beginner

      Today, we’ll discuss how to create thumbnail images in PHP with the help of the GD library.

    11. Create a Custom CAPTCHA and Contact Form in PHP

      Create a Custom CAPTCHA and Contact Form in PHP

      Tutorial Intermediate

      This tutorial will teach you how to create a CAPTCHA in PHP. You'll also learn how to integrate your custom CAPTCHA into a contact form and improve its...

    12. Quickly Build a PHP CRUD Interface With the PDO Advanced CRUD Generator Tool

      Quickly Build a PHP CRUD Interface With the PDO Advanced CRUD Generator Tool

      Tutorial Beginner

      In this article, we’re going to review PDO CRUD—a form builder and database management tool. PDO CRUD helps you build forms for your database tables with...