PHP
Importance of PHP Self Learning & Exploring PHP Resources
PHP is a good language for beginners. It is easy to start and it opens the door for a career in web development. But a training course or a college class can not teach everything. The developers who grow faster are the ones who keep learning by themselves.
Why a course is not enough
A course gives you a strong base: the main topics, a workflow and some real examples. But it has a limited time. PHP has thousands of built-in functions, many extensions, frameworks and tools. No class can cover all of them, and you do not need all of them to start a job. You need to know how to find and learn what you need when you need it.
Why self learning gives you an advantage
- At an interview or a project bid, many people have the same course certificate. What makes you different is what you can do and what you learned more.
- Technology changes. PHP 8 is not the same as the PHP you saw in an old tutorial. Self learners keep up with the change.
- You build the habit to solve problems yourself, which is the main work of a developer.
How to learn PHP by yourself
- Type the code. Do not copy and paste. Run it, break it and fix it.
- Practice every day with small programs. Try the PHP exercises.
- Build small projects: a contact form, a to-do list, a login system, a blog. See the CRUD application.
- Read the official manual. The PHP manual has an explanation and an example for every function.
- Read other code and learn why it is written that way.
- Learn the safe way. Many old examples are not secure. Read PHP Security Tips early.
- Prepare for interviews with PHP interview questions and answers.
Useful PHP resources
| Resource | Good for |
|---|---|
| PHP Manual (php.net) | The official documentation. The function list is at the functions index |
| PHP: The Right Way | Modern good practices, in a simple way |
| Tutorials Class PHP Tutorial | Step by step lessons for beginners |
| W3Schools PHP | Short lessons with a “try it” editor |
| W3Resource PHP Exercises | Many exercises with solutions |
| PHP Exercises | More practice problems |
| Composer | The package manager of PHP. Packages are on Packagist |
| Laracasts | Video lessons on PHP and Laravel |
| OnlinePHP.io | Run and test code online. See online PHP editors |
Happy learning!
List of useful Web Design and Development Blogs
To stay good in web design and development, you need to learn a little every day. Technology changes fast, and the best way to keep up is to read from good sources. Here is a short list of websites and blogs that give useful tutorials, articles and tips.
Blogs and sites to follow
| Site | What you get |
|---|---|
| Smashing Magazine | In-depth articles on design, front-end and back-end, written by experienced professionals |
| Envato Tuts+ | Tutorials and courses on coding and creative skills |
| CSS-Tricks | Tips, guides and examples about CSS, JavaScript and web layout |
| MDN Web Docs | The most trusted reference for HTML, CSS and JavaScript |
| web.dev | Guides on performance, accessibility and modern web practice from Google |
| A List Apart | Articles about web standards, design and the craft of web work |
| Creative Bloq | News, ideas and inspiration for web and graphic design |
For PHP and back-end
- The PHP manual for every PHP function.
- PHP: The Right Way for good practices.
- Tutorials Class PHP tutorial to learn step by step.
Why PHP is a good choice for you?
If you are a student, a fresher or someone who wants to change career, you may ask: should I learn PHP? This article gives an honest answer, with the good points and also the limits, so that you can decide yourself.
What is PHP?
PHP is a server-side language made for web development. It runs on the server, talks with databases like MySQL, and sends HTML to the browser. It is free, and it powers a very large part of the web, including WordPress. If you are new, read the PHP Introduction first.
Good reasons to learn PHP
- Easy to start. You can write a working page in the first hour. The syntax is simple, and there are free tutorials and exercises everywhere.
- Runs everywhere. Almost every web hosting supports PHP, even the cheap ones, so you can publish your work easily.
- WordPress and CMS. WordPress, WooCommerce, Drupal and many other systems are written in PHP. If you know PHP, you can build plugins and themes, and fix problems of existing websites.
- Modern frameworks. With frameworks like Laravel and Symfony you can build serious applications and APIs in a clean way.
- Active language. PHP gets a new version every year. PHP 8 is fast, and has modern features like the match expression and named arguments and more.
- Free and open source. There is no cost for the language, the tools or the learning material.
Limits you should know
- PHP is mostly for web development. For AI, machine learning and data science, Python is the common choice.
- Many people learn PHP, so the competition for jobs is real. Only PHP is not enough, you also need HTML, CSS, JavaScript, MySQL and Git.
- Old PHP code on the internet is often insecure. Learn the safe way from the start, see PHP Security Tips.
Is PHP dead?
No. You will often read that PHP is dead, but the language is updated regularly, big websites run on it, and a large number of businesses still need PHP developers, mostly for WordPress, e-commerce and Laravel projects. What changed is that you should learn modern PHP (version 8), not the old style.
Common questions
I am a beginner. Can I start PHP?
Yes. It helps to know HTML and a little programming, but it is not required. Start with HTML, then PHP basics, and practice every day.
Can I get a job with PHP?
Yes, many companies and agencies hire PHP developers, and freelancers find a lot of WordPress and Laravel work. But no course gives a job automatically. You get a job with skills and proof: a few real projects, clean code and good basics. Prepare with our PHP interview questions.
Should I choose PHP, Python or JavaScript?
It depends on your goal. For websites, CMS and e-commerce, choose PHP. For AI and data, choose Python. For front end and modern web apps, JavaScript is needed anyway. Read the comparison in Python vs PHP vs JavaScript Trends.
A simple roadmap to learn PHP
- Learn HTML and basic CSS.
- Learn PHP basics: variables, decisions, loops, functions and arrays.
- Practice with PHP exercises.
- Learn forms, sessions and files: PHP Advanced.
- Learn MySQL with PHP and build a small CRUD project: PHP Simple CRUD Application.
- Then learn OOP, Composer and a framework like Laravel.
Start today, and be regular. Even 30 minutes every day is better than a long study once in a month.
List of online Editors to run PHP online
To run PHP on your own computer you need a web server and PHP, for example from XAMPP (see PHP Installation). But if you just want to try a few lines of code, you do not have to install anything. An online PHP editor lets you write PHP in the browser and run it at once. You only need a browser and internet.
These tools are also called a PHP sandbox, an online PHP compiler or an in-browser IDE. They are very good for learning, for testing a small function, and for checking how code behaves in different PHP versions.
Online PHP editors that work
Paiza.io
A free online editor and compiler for many programming languages, PHP included. You can write the code, run it, save it and share the link. Open Paiza.io PHP editor.
OnlinePHP.io
A PHP sandbox that runs your code on more than 400 PHP versions, from very old ones to PHP 8.5. You can compare the result of up to five versions side by side. It is very useful to see if your code works on the PHP version of your hosting. Open OnlinePHP.io.
3v4l.org
The name means “eval”. It runs a script on hundreds of PHP versions and shows the output of every version, so you can find in which version a behaviour changed. Open 3v4l.org.
PHPTester.net
A simple online tool to run PHP code, where you can choose a PHP version (from 5.6 to 8.3, at the time of writing). Open PHPTester.net.
TutorialsPoint Online PHP Compiler
A simple in-browser PHP compiler that you can use without any signup. Open the TutorialsPoint PHP compiler.
Limits of online PHP editors
- Many of them block functions like
mail(), file writing and database connections for security. - You can not run a full website, with many files, sessions and a MySQL database. For that, install XAMPP or similar on your computer.
- Most of them have a time limit and a memory limit for every script.
How to choose
| You want to | Use |
|---|---|
| Run a quick example and share it | Paiza.io |
| Check the code on different PHP versions | OnlinePHP.io or 3v4l.org |
| Learn the basics and practice exercises | Any of them, and then install PHP on your computer, see PHP Installation |
After you try the basics online, practice the PHP exercises and read the PHP tutorial.
Note: we removed two old tools from this list (WritePHPOnline and the old OnlinePHPFunctions sandbox), because they are not working anymore.