Welcome to the learn-php.org free interactive PHP tutorial.
Whether you are an experienced programmer or not, this website is intended for everyone who wishes to learn the PHP programming language.
There is no need to download anything – just click on the chapter you wish to begin from, and follow the instructions.
Note: learn-php.org is still under construction – If you wish to contribute tutorials, please click on
Contributing Tutorials down below.
Learn the Basics
- Hello, World!
- Variables and Types
- Simple arrays
- Arrays with keys
- Multidimensional arrays
- For loops
- While loops
Read more here: Contributing Tutorials Start Exercise
What is PHP?
PHP (Hypertext Preprocessor) is a popular open source scripting language. It is particularly well suited for web development and much more. PHP is also a server-side scripting language which means that the code is executed in the server.
What can you do with PHP?
PHP has a lot of usage aside from creating web pages. The following are some of them:
- Security – using PHP, developers can implement user authentication for web applications.
- Database-friendly – PHP supports a lot of databases including the most popular ones such as MySQL, MongoDB, Oracle, MS SQL, etc.
- REST and web services – with native support for JSON and XML, creating web services with PHP should be a breeze.
- Ecommerce and CMS – with most CMS written in PHP, developers can create and manipulate themes and plugins easily, making websites and ecommerce platforms more efficient.
- System scripting – using PHP’s command line interpreter, system and site administrators can perform maintenance tasks on servers.
Why use PHP?
- Popularity – because of PHP’s popularity, it has created a huge community. With huge community comes easier and faster support. Documentation is also very extensive.
- Free – as an open-source software, PHP is free to use, thus cutting the development budget.
- Database compatibility – with PHP supporting a wide range of databases, developers are not restricted with their choice of databases.
- Cloud services – Most projects today use cloud computing platforms such as AWS. PHP applications are supported by these cloud services, making it easier to integrate and deploy on cloud servers.
Requirements for this tutorial
- Echo and Print
- For Loop
- Foreach Loop
- While Loop
- Do…While Loop
- Sorting Arrays
- Date and Time
- Include Files
- File Handling
- File Upload
- Form Validation
- Error Handling
- Classes and Objects
- Constructor and Destructor
- Access Modifiers
- Abstract Classes
PHP Functions and Methods
Why Learn PHP?
PHP is a widely used server-side programming language that’s become increasingly fast and powerful over the years. PHP works well with HTML and databases, making it a great language for anyone interested in building dynamic web applications.
In this course, you’ll be exposed to fundamental programming concepts in PHP.
Note on Prerequisites:
Some basic HTML is helpful before taking this course.
EarnCertificateof completion with
Time to Complete25 Hours
Codecademy courses have been taken by employees at
- 1Getting Started with PHPLearn how PHP is used in modern web development to create dynamic web pages for visitors.View DetailsStart
- 2Learn PHP VariablesLearn about PHP variables and the string and number data types.View DetailsStart
- 3Introduction to Functions in PHPGet started learning about functions in PHP so you can create your own reusable blocks of code.View DetailsStart
- 4PHP Built-in FunctionsPHP contains built-in functions for completing common (and some niche) tasks. This course will teach you how to find and use functions.View DetailsStart
- 5Learn PHP ArraysLearn about PHP ordered and associative arrays and how this data type is used to store, access and manipulate data.View DetailsStart
- + 5 more lessons
WHAT YOU’LL CREATE
Portfolio projects that showcase your new skills
- World TravelerHelp a weary traveler convert their various international currencies into USD.
- Mad Lib FunctionsIt’s time for you to start building your own functions in PHP. Creating reusable blocks of code is an extremely useful skill in any language. Get started practicing in PHP with this mad lib project!
- The Hitchhiker’s Guide to PHP Math FunctionsExplore the universe of PHP documentation and find the PHP functions you need for your journey. Applying them correctly will yield the answer to life, the universe, and everything.
About this Free Certification Course
In this course, you will learn about the basic concepts of PHP. You will start this course by knowing what PHP is, its syntax along with applications. Moving ahead you will learn the installation of PHP and essential concepts involved in it such as comments, variables and different data types. Then we will jump to control statements such as if, if-else, switch-case and loops. You will also learn about the types of operators available in the PHP. Then, you will see some functions that are used to manipulate strings. Lastly, you will learn important concepts such as functions and arrays.
- Basics of PHP
Introduction to PHPPHP InstallationComments in PHPVariables in PHPDatatypes in PHPControl Statements in PHPOperators in PHPStrings in PHPFunctions in PHPArrays in PHP
HOW YOU’LL MASTER IT
Stress-test your knowledge with quizzes that help commit syntax to memory
“I know from first-hand experience that you can go in knowing zero, nothing, and just get a grasp on everything as you go and start building right away.”— MADELYN, PINTEREST