The Best Way To Learn PHP
This post is not a tutorial on PHP, but will rather guide you about the various resources and steps you can take to learn the language.
Step 1: Understand what PHP is, and what PHP isn't
PHP is a language that makes websites more dynamic. You can't make that cool hover effect with PHP, but you can make a login system out of it. You can't make a game with PHP, but you can make a blog. Wordpress, phpBB, Joomla, these are all made with PHP. PHP is server-side, unlike javascript. This means, that PHP is installed on the web server, and whatever the code is, is executed on the server and then sent to the browser. All the browse recieves is plain HTML - the result of executing PHP. But javascript is executed by the browser. The server ignores the javascript code completely, the browser interprets it and the result is shown.
Step 2: Get PHP on your local machine
PHP is pre-installed on almost all web servers today. To start learning PHP, you are gonna need PHP it self, but getting a host, uploading your files to the server everytime to see the result, that's really tedious work and a lot of time gets wasted. A better way is to install PHP on your local machine. Now PHP is not the only thing you will need. You are also going to need Apache and MySQL. The best option is to download XAMPP(for windows), an application that puts this all in one easy to use and set up package. All you need to do is go to http://apachefriends.org/ and download XAMPP, it's free. A Mac alternative called MAMP is available at http://mamp.info/
Step 3: Watch videos
Now for learning ANY language, you need to understand the basics of the language. If the basics are not clear, you are gonna have a tough time learning the more advanced concepts of the language. Now I have spent countless hours reading this blog, that blog. This of course did help me, but a lot more helpful and better resource is videos. http://phpacademy.org/ has excellent videos on PHP, you can learn a lot from the place, the instructor Alex explains everything clearly, and I learnt a lot of concepts I hadn't understood while reading blogs. http://lynda.com/ is another good resource, I haven't used it personally, but a lot of people recommend it. You can also watch a series of 200 videos on PHP on TheNewBoston at http://thenewboston.org/list.php?cat=11, recommended by Fergal.
Step 4: Learn to use PHP with MySQL
MySQL is a database management system that you are gonna use a lot. Blogs, forums, websites, almost everything uses databases. Databases are used for storing accounts, posts, PMs, everything. MySQL is a database management system that you can use with PHP. phpMyAdmin is a tool written in PHP that makes creating MySQL databases and tables a piece of cake. This aspect of PHP is very easy, yet very important. You want to learn this right after you learn the basics. Again, many informative videos are available for this.
Step 5: Build something simple
Learning a language is like Math. To fully understand a concept, you need to use it, apply it. For starters, you can build a simple application that fetches data from a database.
Step 6: Build something slightly complicated
Now that you can fetch data from a database, a login/register system is perfect for this level. If you are feeling a little bit more adventures, try adding permission levels like Registered, Moderator, Banned and Admin. Different levels display different outputs!
Step 7: Learn the advanced concepts
You must be familiar with the basics now, and able to create a simple, functioning website. It's time to learn the advanced concepts now soldier! I suggest going for OOP. You can always google about this, you'll get a ton of tutorials on different topics.
Step 8: Try out a framework
Now I have never tried a framework personally, except Code Igniter, but they save you a lot of work. Try learning Code Igniter first, and once you have a grip on it, go for a full-stack framework like Laravel.
Step 8: Build something ultimate!
So you made it to the final step, huh? Well, to get your certificate, you need to prove yourself! Try going for a blog at this point, or even something like a forum!
Many people recommend you to read books, but frankly I have never felt the need. There are enough resources available online, you can learn PHP easily without spending a cent.
Hope I Helped,
agarwal99







