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 Create a Multiline String in PHP: 3 Methods

      How to Create a Multiline String in PHP: 3 Methods

      Tutorial Beginner

      This quick tip will show you how to create a multiline string in PHP using three different methods.

    2. Write to Files and Read Files With PHP

      Write to Files and Read Files With PHP

      Tutorial Beginner

      In this tutorial, you'll learn several important functions in PHP which are sufficient for all your basic file reading and writing needs. You'll learn how to...

    3. Send Emails in PHP Using Symfony Mailer

      Send Emails in PHP Using Symfony Mailer

      Tutorial Beginner

      In this article, we're going to explore the Symfony Mailer library, which allows you to send emails from PHP applications. Starting with installation and...

    4. Gates and Policies in Laravel

      Gates and Policies in Laravel

      Tutorial Beginner

      Master the authorization system of the Laravel web framework, which works with gates and policies. Learn how to use gates and policies and then how to...

    5. How to Make a Live Chat Script in PHP

      How to Make a Live Chat Script in PHP

      Tutorial Intermediate

      In this article, we’ll discuss how you can make a live chat script in PHP. Although there are different ways you could achieve this, we’ll use a socket-based...

    6. Set Up an OAuth2 Server Using Passport in Laravel

      Set Up an OAuth2 Server Using Passport in Laravel

      Tutorial Intermediate

      Learn how to set up a fully fledged OAuth2 server in Laravel using the Laravel Passport library. We’ll go through the necessary server configurations along...

    7. How to Create a Custom Authentication Guard in Laravel

      How to Create a Custom Authentication Guard in Laravel

      Tutorial Intermediate

      Learn to create a custom authentication guard in the Laravel framework by extending the core Laravel authentication system.

    8. How Laravel Broadcasting Works

      How Laravel Broadcasting Works

      Tutorial Intermediate

      Today, we are going to explore the concept of broadcasting in the Laravel web framework. It allows you to send notifications to the client side when...

    9. Eloquent Mutators and Accessors in Laravel

      Eloquent Mutators and Accessors in Laravel

      Tutorial Beginner

      In this article, you'll learn about mutators and accessors in the Laravel Eloquent ORM. We'll go through a handful of examples to help you understand these...

    10. How to Use PHP in HTML

      How to Use PHP in HTML

      Tutorial Beginner

      In this article, we’re going to discuss how you can use PHP code in your HTML pages. It’s aimed at PHP beginners who are trying to strengthen their grip on...

    11. Deferring Tasks in Laravel Using Queues

      Deferring Tasks in Laravel Using Queues

      Tutorial Intermediate

      Learn about the Queue API in the Laravel web framework. It allows you to defer tasks during script execution to enhance the overall user experience.

    12. Exception Handling in Laravel

      Exception Handling in Laravel

      Tutorial Beginner

      In this article, we're going to explore one of the most important and least discussed features of the Laravel web framework—exception handling.