🚨 $100K in Sight: Follow Bitcoin’s Final Push Live! TRACK NOW
10 Tips to Learn PHP

Before you begin to learn PHP, it might be wise to take a moment to plan your approach to learning the language.

Professional developers that have learned PHP have spent a significant number of hours learning their craft. To emulate them, you will need to ensure that you are motivated to do the same, and ideally able to learn PHP quickly and efficiently. The slower and more inefficient your learning methods, the longer it will take for you to get a job in PHP development or build the application you have in mind.

An even worse consequence of a slow and inefficient learning approach is that you will be more likely to give up on studying! Research conducted by Harvard and MIT universities found that only 4% of students that sign up for online courses complete them.

So, how can I help you avoid becoming another one of the 96% of people who give up?

Well, I’ve put together a list of 10 tips to help you learn PHP. The tips should help you approach learning PHP effectively, keep you motivated, and also avoid some potential difficulties.

Let’s get right to ‘em!

Tip 1 – Be confident you want to learn PHP

If you have arrived on this article as a newcomer to programming, you might not have a strong preference about which programming language to learn. While that's not necessarily a problem, it could lead to a problem later down the line in which you realize that a different programming language is better suited to your aspirations. PHP is a server-side programming language commonly used in web development; if you realize in a couple of months that what you actually want to do is to work at Rockstar and help build the next edition of Grand Theft Auto, then you would have been better served learning a programming language commonly used in game development such as C or C++. There are lots of great reasons to learn PHP, including:

Latest Deal Active Right Now:

  • You want to take your WordPress skills to the next level. As of September 2018, 7% of all websites use WordPress. As WordPress is powered by PHP, that creates a huge demand for PHP skills. And if you wanted to use other content management systems, such as Joomla or Drupal, I'm pleased to tell you that they are built with PHP also.
  • PHP is considered to be relatively easy to learn compared to other programming languages.
  • As PHP is native to the web, you'll be able to put simple projects online a lot quicker and with less difficulty, than you would be able to with some other languages, meaning you will see results for your efforts much quicker than if you were to learn another language.

So, before you start to learn PHP, make sure you consider these so that you can be confident that PHP serves your needs.

Tip 2 – Keep your projects in mind

Now that you know why you want to learn PHP, it is also useful to have an objective in mind for what you want to do with it. Learning PHP will be a long process, and staying motivated will be easier with an end goal in mind. Online courses, such as BitDegree's Learn PHP Online course, keep the learning process interesting and interactive by having you build a project as you learn the fundamentals of PHP development. This is a great way to make the learning process interesting and relatable, but even better is having the idea of your project in mind. If you keep your project in mind, you will have a greater incentive to remember what you learn if you want to apply it to your project. You will need to continually practice your newly developing PHP skills, and it is usually easiest to motivate yourself to work on your project. You can even build different versions of your project as your skills progress. For example, you could initially create a simple contact app that has basic functionality to add and delete contacts. As your skills develop you could hook this up to a database. Later you could add more advanced functionality, before putting it live and inviting your friends to submit their details. Before you know it, you could be the owner of one of the world's largest social networking sites connecting more than a billion people and generating billions of dollars in advertising revenue. Who knows?

Tip 3 – Learn HTML first

While PHP is a fine choice as your first programming language, it shouldn't be your first step in web development. If you haven't learned it already, you should dedicate some time to learning HTML before you start to learn PHP. HTML is a markup language, rather than a programming language, that forms the basis for web pages. This means that the code you write represents the basic elements of a web page, such as images or text. You can't program any functionality with a markup language, which makes it relatively simple to learn, and has also created the need for a language like PHP to be used in addition to HTML to make websites more dynamic. As PHP is generally used to make HTML dynamic, HTML is commonly seen in PHP documents. Not only will HTML be present in most applications of PHP, but it will also be part of many tutorials and lessons on PHP development. Most of these tutorials will simply assume that you already know HTML. So rather than finding yourself learning both at once, take a few hours to learn the basics of HTML. Learning PHP will take months, but the time needed to learn HTML is a matter of hours. You could start with BitDegree's Space Doggos course, which will not only teach you HTML and CSS but will also feature our lovable Doggo!

learn HTML and CSS with Space Doggos

Tip 4 – Active learning over passive

One of the best ways to make learning more effective is to learn actively rather than passively. To learn passively means to simply watch/read/listen and absorb information. To learn actively means to use what you're learning in a problem or project. Educational professionals seem to be unanimous in their belief that active learning strategies are better than passive ones. The only problem is that creating an active learning experience is generally more difficult than creating a passive one. BitDegree's 'Learn PHP Online' course is a great example of an active learning experience. To advance past each lesson in the course, you have to solve the problem by using what you have just learned in the code editor.

Learn PHP - PHP in action

An example of passive learning experience would be watching a YouTube video of an instructor voicing over a slideshow which explains what functions are. Passive learning experiences can still be useful, though. The instructor might offer the best explanation of what a function is that you've ever heard. The advice here isn't necessarily to avoid passive learning experiences entirely but to try to make them active. You could take the examples in the lecture and write them out yourself, making alterations and seeing what happens.

Tip 5 – Don't be afraid to break things

Be careful with this advice. If you are working on a live site, purposefully breaking things is certainly not the best idea. If you are working with WordPress, it is generally advised to leave the PHP files in the WordPress core alone. Don't break those. But in offline project files you create, or in the PHP files in the WordPress theme folders, breaking things isn't a bad idea. You'll learn a lot from putting them back together. This advice doesn't strictly mean you have to break your websites, but rather that you shouldn't be afraid of it happening. Things going wrong is generally an excellent learning experience. The bigger the problem, the better you will remember the solution. For beginners, the interactive code editors in the BitDegree 'Learn PHP Online' course are a great environment in which to experiment. You can rest assured that whatever you do to the code you will be editing, you won't be able to take the whole BitDegree website down so experiment. By the way, if the course exceeds a bit your finances at the moment, you can try to apply for BitDegree micro-scholarships. A sponsor might fund your course fees and help you out with a little reward at the end! If you have a couple of ideas on how to solve a problem and the first one works, make sure you try your second idea too, rather than simply advancing. In web development, there's usually more than one way to solve a problem.

learn PHP: how to become a web developer

 

Tip 6 – Turn on Error Reporting in PHP.ini

If you are going to break things, it may be wise to make sure error reporting is enabled. This may well be enabled by default, but in some instances when you break your PHP application, all you will see is a blank screen. To see an error report, ensure that you turn to enable error handling in your php.ini file by using the code: ini_set('display_startup_errors', 1); ini_set('display_errors', 1); error_reporting(-1); That will mean that when you make an error in your code, an error report like the one below (the result of a missing semi-colon) will at least return a somewhat helpful message to help you debug the problem.

learn php

Tip 7 – Be careful with the syntax

In both your coding education and your life as a professional developer, you will lose hours of your life to syntax errors. A syntax error just means you wrote something that PHP didn't understand. It could be because you spelled the name of a variable differently from how you did when you created it, or you forgot to put a semicolon at the end of your statement. You're going to forget that semicolon a lot. Some programming languages, such as JavaScript, are more liberal on the use of semicolons than a language like PHP is. In some cases PHP can be quite liberal too: for instance, it is considered good practice in some situations to not close your PHP tags. In other situations, one missing semicolon kills the whole application. So be very careful with your syntax. In programming, it's imperative to spell things correctly. But this knowledge of the probability of syntax errors is useful. It tells us where to look first when your program doesn't work. Before deleting your whole program and starting again, check for a syntax error.

Tip 8 – Keep your code readable

As you learn to code, you will be learning from instructors that take great care with the presentation of their code. And if you're not... you should find a different instructor. At first, all the spacing, indentations and alignment might seem superficial. If the code works, it works, right? Who cares about the spacing? Well, when you make a mistake or come back to the review the code you wrote a while ago, you will care. Worse still, if your colleagues have to work with your code that you haven't kept readable, you will care even more, because your colleagues will hate you. Well-Written code is essential for dealing with the errors discussed in tip 7. If you put all your code on one line, the computer will be able to read it just fine. But if you've missed a semicolon, you or someone else has to spot that. Which example would be easier to spot a missing semi-colon in?

learn php example

Or

learn php example

In case that isn't obvious, it's the same code. The only difference is the spacing. The first version of the code makes it easier to spot semi-colons at the end of each line while having the HTML span tags and opening (<?PHP) and closing (?>) PHP tags in alignment also helps to identify if you simply forget to include a closing tag. The second version is just all the code rammed together. Now you have to check all the code for potential missing semi-colons rather than just taking a quick look at the end of the line. Where do the PHP tags start and end? They have their lines in version one, but you have to scan all of the code from opening tag to closing tag in version two of the code to check they are both there. In addition to keeping your code clean, clear and readable, be sure to make use of comments to remind yourself what you were thinking when you wrote your code. Comments are lines of text that are ignored by the PHP interpreter. You can turn your text into a comment by including two forward slashes at the start of the line.

// Like this.

The computer completely ignores your comments, making them seem kind of pointless. But while code is for the computer, the comments are for the humans. Particularly if you write something complex, comments can be extremely useful for either other people or yourself in the future to understand or remember what your program does. For example, below I wrote a comment above this Wordpress custom query to remind me what it is when I learned it. The comment is the grey text that begins with //.

learn php example

Comments can be a great way to leave little notes for yourself to help you remember how to do things. As a newbie, you are very likely to re-visit the code you write now in the future. When someone asks you to build something you've built before, referring to the code you wrote and understood before can be easier to use than trying to understand someone else example you found via Google.

Well, it will only be easier if your code is clean, clear, easy to understand and makes good use of comments.

Tip 9 – Try to solve problems yourself

When you do run into a problem, a common reaction is to immediately ask for help.

Now, there's nothing wrong with asking for help. A lot of people would say it should be encouraged. But if you ask someone as soon as you get stuck, you're not going to learn the lesson anywhere near as well as you would have done had you figured out the problem yourself. There is a right time to ask a question.

This might seem like more of an issue at a coding boot camp in real life, rather than online, as in a boot camp you can raise your hand and ask an instructor for help. However, courses like those on BitDegree give you the option to send feedback on any lecture in the course so that the instructor can help you with any problems you encounter.

Learn PHP - Feedback

But remember, when you are learning PHP, you aren't blazing a trail – you are not the first person to learn this programming language.

Plenty of people went before you, and their questions are all over the internet. There are also plenty of people who want to help, and their answers are also all over the internet.

Particularly if you are near the beginning of your learning experience, studying PHP basics, it's extremely unlikely your problem hasn't been encountered before by someone else. So, if you want to find an answer to any problem you have with PHP, then just do what you do to solve all your other problems. Google it!

At the top of the search results, you will find that someone has probably posted an eerily similar question to yours on Stackoverflow.

If you can't find a match to your question, it's also worth remembering that PHP, like every other programming language, has extensive documentation to help its users understand how to use PHP. If the manual is a bit overwhelming, a more digestible PHP knowledge base is available on BitDegree.

BitDegree learn PHP

Tip 10 – Understanding jargon

One difficulty you may encounter early on when learning PHP is the technical language used by your instructors or in instructions.

A good instructor will be able to explain the PHP basics to you in plain English. But once you get on to more advanced topics, the instructor will need to use more technical language to describe concepts of greater complexity.

It's important that you learn the words in your new vocabulary sufficiently to be able to understand sentences that might use two or more jargon words in them. Unfortunately, it's unlikely you will ever fully understand how to use PHP unless you can understand the difficult concepts behind it, and that means learning a technical language.

A simple example would be understanding 'how to pass a variable as an argument to your function.'

BitDegree's 'Learn PHP Online' Course covers the concepts of variables, functions, and arguments as part of its curriculum on PHP basics, so by the end of the course, that sentence should make perfect sense to you. If you're afraid that could prove difficult, then consider noting down what each jargon word means when you come to them, to be able to review them when an instructor uses a sentence like that later in your PHP education.

See & compare TOP online learning platforms side by side

Did you know?

Have you ever wondered which online learning platforms are the best for your career?

Conclusion

The tips in this guide will help to prepare you to be a better PHP student, and ensure a more efficient learning process if followed correctly.

While most of these tips are aimed at those at the start of their quest to learn how to use PHP, some will prove useful for those at a more advanced stage of their PHP education.

But anyway, now that you've put some research into it, you may have made your choice to learn PHP. If that’s the case, there’s only one thing left to do…

It’s time to learn PHP!

It can be a daunting process, as can anything that we choose to learn. But for many, it’s a beautiful road, and there’s a massively rewarding feeling at the end of it. Stick to the tips in this guide and you’ll be well on your way.

If you have any questions for me, please do not hesitate to ask. Simply leave a comment below and I’ll get back to you as soon as possible!


Scientific References

About Article's Experts & Analysts

By Aaron S.

Editor-In-Chief

Having completed a Master’s degree in Economics, Politics, and Cultures of the East Asia region, Aaron has written scientific papers analyzing the differences between Western and Collective forms of capitalism in the post-World War II era. W...
Aaron S. Editor-In-Chief
Having completed a Master’s degree in Economics, Politics, and Cultures of the East Asia region, Aaron has written scientific papers analyzing the differences between Western and Collective forms of capitalism in the post-World War II era.
With close to a decade of experience in the FinTech industry, Aaron understands all of the biggest issues and struggles that crypto enthusiasts face. He’s a passionate analyst who is concerned with data-driven and fact-based content, as well as that which speaks to both Web3 natives and industry newcomers.
Aaron is the go-to person for everything and anything related to digital currencies. With a huge passion for blockchain & Web3 education, Aaron strives to transform the space as we know it, and make it more approachable to complete beginners.
Aaron has been quoted by multiple established outlets, and is a published author himself. Even during his free time, he enjoys researching the market trends, and looking for the next supernova.

TOP3 Most Popular Coupon Codes

Verified

GET 50% OFF

DataCamp Black Friday Sale
Rating 5.0
Verified

GET 55% OFF

Udacity Black Friday Discount
Rating 5.0
Verified

UP TO 30% OFF

Special edX Black Friday Deal
Rating 5.0

Leave your honest feedback

Leave your genuine opinion & help thousands of people to choose the best online learning platform. All feedback, either positive or negative, are accepted as long as they’re honest. We do not publish biased feedback or spam. So if you want to share your experience, opinion or give advice - the scene is yours!


Recent User Reviews

Saul Reid

Aug 12, 2024

A very good tutorial, super.

This is the thing I needed the most! Now I know what actually happens under the hood of those fancy frameworks!

Otis Ellis

Oct 01, 2024

Gonna give it a thorough read

This article is already looking more promising. I'm reading all of this and taking notes

Darrell Cook

Sep 11, 2024

Clean and clear explanation !

Thank you so much ! This helped a lot in learning PHP for my apprenticeship!

Taylor Franklin

Sep 04, 2024

Thanks!

I've been trying to get into PHP to learn Wordpress for 2 months but never knew where to start. Thanks!

Gary Hines

Aug 09, 2024

This is what i just needed

Great stuff, I was planning on learning php during my work leave ?

Marty Rodriquez

Sep 23, 2024

Refreshing ❤

I'm PHP developer for 3 years , and I still learn new things thanks to you guys !

Evelyn Owens

Sep 18, 2024

Thank you so much!

I can see how much effort was put on this article, and I truly appreciate it.

Lionel Hart

Oct 02, 2024

Thanks for the great content!

Very good content and I'm very happy to have this great tutorial

Cecilia Hoffman

Oct 30, 2024

??❤ Thanks for sharing

Thank you for the excellent php tut. Just what I needed!

Felicia Collier

Oct 19, 2024

Perfect stuff.

I'll finish this over the weekend and I can start with real projects on the job from Monday.

Cary Flores

Oct 22, 2024

Thank you :D

Thanks for making this article. I was missing the PHP content on this website.

Bob Bowen

Oct 08, 2024

What a great work !

It's amazing to have content like this for free on on the internet ! Thank you so much !

Jenna James

Oct 04, 2024

Yay! ??

This is what I have searching for!! Thanks, guys! :))

Tyrone Nguyen

Aug 12, 2024

Thank you so much

Excellent effort, thank you very much. Love the beginner version build up of your article, very useful.

Katrina Nichols

Sep 28, 2024

Thanks alot

Thanks for this tutorial. I didn't learn php fully before learning other stuff. This tutorial makes me feel like understanding other languages even more.

Steve Johnston

Aug 16, 2024

Thank for this lesson.

Really good tutorial. Tomorrow I'm starting first job as php dev and it helped me a lot.

Holly Powell

Aug 25, 2024

Loved this tutorial ❤️

Maaan the amount of work you have done is just incredible, thanks a lot !!!

Cynthia Myers

Oct 31, 2024

Really helpful for me

Cheers guys this may have saved my life, I’m 4 weeks behind on my uni course and this has given me some hope.

Marilyn Alvarez

Aug 23, 2024

highly apperciate this

awesome presentation, so easy to follow, nice flow and very informative, lots of useful simple use-case knowledge

Jonathon Cortez

Oct 31, 2024

You did it right!

Been meaning to learn some php since even in 2020 freelance money mostly seems to be in wordpress. So thanks!

FAQ

Can I learn PHP without knowing HTML?

It is not necessary that you need to know HTML before learning PHP. However, it is highly recommended to start with HTML and then move on to PHP, so it would make more sense for you to get the whole idea behind programming and building webpages. You can also find out more on how the PHP and HTML languages differ to make your final decision.

How do I start PHP?

You can start learning PHP online, so you will be able to manage your time how you want without any obligations. There are a lot of useful courses and tutorials online, that you should try and improve your skills in PHP. Also, keep in mind that you need to practice a lot, therefore don't avoid practical exercises.

How do you choose which online course sites to review?

We pick online learning platforms according to their market size, popularity, and, most importantly, our users' request or general interest to read genuine MOOC reviews about certain online learning platforms.

How much research do you do before writing your e-learning reviews?

Our dedicated MOOC experts carry out research for weeks – only then can they say their evaluations for different aspects are final and complete. Even though it takes a lot of time, this is the only way we can guarantee that all the essential features of online learning platforms are tried and tested, and the verdict is based on real data.

Which aspect is the most important when choosing the best online learning platforms?

It wouldn't be right to pick just one aspect out of the selection: priorities depend on each individual person, their values, wishes, and goals. A feature that's important to one person can be utterly irrelevant to the other. Anyhow, all users would agree that good quality of the learning material is a must for online learning platforms.

How is this e-learning review platform different from others?

Every MOOC-reviewing platform is unique and has its own goals and values. Our e-learning reviews are 100% genuine and written after performing a careful analysis. That is the goal that a lot of e-learning review sites lack, so we consider it to be our superpower!

Bybit
×
Verified

$30,000 IN REWARDS

Bybit Black Friday Deal
5.0 Rating