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. How to Use cURL in PHP

      How to Use cURL in PHP

      Tutorial Beginner

      Today, we’re going to explore the cURL extension in PHP, which allows you to make HTTP requests from your code.

    2. How to Generate a PDF File in PHP

      How to Generate a PDF File in PHP

      Tutorial Beginner

      In this article, we’re going to discuss how you can generate PDF files in PHP. We'll use the TCPDF library to demonstrate how to create PDF documents.

    3. Understanding Variable Scope in PHP

      Understanding Variable Scope in PHP

      Tutorial Beginner

      In this tutorial, you will learn about variable scope in PHP. We will also cover the usage of global and static keyword.

    4. Formatting the Current Date and Time in PHP

      Formatting the Current Date and Time in PHP

      Tutorial Beginner

      This tutorial will teach you how to format the current date and time in PHP. You will also learn how to get the timestamp from a date string and how to add...

    5. 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.

    6. 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...

    7. 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...

    8. 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...

    9. 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...

    10. 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...

    11. 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:...

    12. 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...