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. Create a Google Login Page in PHP

      Create a Google Login Page in PHP

      Tutorial Intermediate

      Learn how to integrate Google login in your PHP website. We’ll use the Google OAuth API, which is an easy and powerful way to add Google login to your site.

    2. How to Send Text Messages With PHP

      How to Send Text Messages With PHP

      Tutorial Beginner

      Text messaging has become extremely widespread throughout the world—to the point where an increasing number of web applications have integrated SMS to notify...

    3. How to Paginate Data With PHP

      How to Paginate Data With PHP

      Tutorial Intermediate

      In this article, we'll discuss how to paginate data with PHP. At the end, we'll also discuss how you can implement AJAX-based pagination.

    4. PHP Integers, Floats, and Number Strings

      PHP Integers, Floats, and Number Strings

      Tutorial Beginner

      Learn about integers and floats in PHP, as well as the functions which can be used to determine the type of numbers that we are dealing with and convert...

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

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

      Tutorial Beginner

      Learn the basics of file upload in PHP. Firstly, we’ll go through the PHP configuration options that need to be in place for successful file uploads....

    6. How to Use the Modulo Operator in PHP

      How to Use the Modulo Operator in PHP

      Tutorial Beginner

      This tutorial will help you familiarize yourself with the Modulo operator—one of the fundamental arithmetic operators in PHP. In this post, we'll discuss...

    7. Generate Random Alphanumeric Strings in PHP

      Generate Random Alphanumeric Strings in PHP

      Tutorial Intermediate

      This tutorial will teach you how to generate random numbers and alphanumeric strings in PHP. We will discuss how to create strings with a specific set of...

    8. Working With PHP Arrays in the Right Way

      Working With PHP Arrays in the Right Way

      Tutorial Intermediate

      Become a stronger PHP developer using a list of common array functions, with examples of usage and best practices.

    9. PHP Control Structures and Loops: if, else, for, foreach, while, and More

      PHP Control Structures and Loops: if, else, for, foreach, while, and More

      Tutorial Beginner

      Today, we're going to discuss control structures and loops in PHP. I'll show you how to use all the main control structures that are supported in PHP, like...

    10. WP_Query Arguments: Categories and Tags

      WP_Query Arguments: Categories and Tags

      Tutorial Intermediate

      In the next part of this series on mastering WP_Query, I'll show you the arguments you can use to query categories and tags with WP_Query and how to code them.

    11. PHP Namespace Tutorial: The Basics

      PHP Namespace Tutorial: The Basics

      Tutorial Beginner

      In this tutorial, I'll go through the basics of namespaces in PHP. I'll explain why you might need namespaces and I'll show you how to use PHP namespaces in...

    12. How to Autoload Classes With Composer in PHP

      How to Autoload Classes With Composer in PHP

      Tutorial Beginner

      In this article, we’ll discuss the basics of autoloading in PHP and how to autoload PHP classes with Composer. I'll explain why autoloading is so important...