The Best Way To Learn PHP

agarwal99

New Arrival
Joined
Mar 20, 2013
Messages
20
Reaction score
0
FP$
6
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
 
That's a great tutorial, thanks for sharing it with us. In addition to the videos you suggested, I'd recommend http://thenewboston.org/list.php?cat=11. They are free and an excellent way to get started with PHP. I've watched about 100 of them myself and found them really easy to get through.
 
Fergal said:
That's a great tutorial, thanks for sharing it with us. In addition to the videos you suggested, I'd recommend http://thenewboston.org/list.php?cat=11. They are free and an excellent way to get started with PHP. I've watched about 100 of them myself and found them really easy to get through.

Updated the post. Thank you 🙂
I'll probably make a series out of this with one post for HTML, and one for CSS as well
 
Actually for PHP is a Server Database Language. I use XAMPP for making it server dynamic sites.
 
realmartian said:
Actually for PHP is a Server Database Language. I use XAMPP for making it server dynamic sites.

PHP is a server side language for sure, but its not a database language. You just interact with database using it.
 
I think PHP5 does have a built-in SQLite engine for simple database operations (using "flat files"). But I personally use PHP with MySQL, as part of XAMPP.
 
agarwal99 said:
You can't make a game with PHP

Ah the that is partly false. All the good games are code with PHP. It may not be a game with just only PHP but is used more than often. It can be used to create game logic and engines.
 
Pvcomputers said:
agarwal99 said:
You can't make a game with PHP

Ah the that is partly false. All the good games are code with PHP. It may not be a game with just only PHP but is used more than often. It can be used to create game logic and engines.

If the game has a system version (e.g a program, exe, jar, etc) and a website version, then yes PHP or ASP is probably behind the website so that it can communicate with the game, but usually the game logic and engine would be written in the game's native language.
 
Great tutorial you have here, I am actually trying to learn PHP myself and found this very useful. Appreciate it!
 
Yea you can build games with PHP, they just won't be super interactive. Probably a lot of page refreshing. You click the attack button, page reloads, then it tells you how much damage you did, etc. Not what most people think of when they think "game" but that's their fault for not knowing what a game is.
 
death180 said:
Yea you can build games with PHP, they just won't be super interactive. Probably a lot of page refreshing. You click the attack button, page reloads, then it tells you how much damage you did, etc. Not what most people think of when they think "game" but that's their fault for not knowing what a game is.

That's where AJAX comes in.
 
Jake said:
death180 said:
Yea you can build games with PHP, they just won't be super interactive. Probably a lot of page refreshing. You click the attack button, page reloads, then it tells you how much damage you did, etc. Not what most people think of when they think "game" but that's their fault for not knowing what a game is.

That's where AJAX comes in.

Exactly, you can do anything if you involve more technologies.
 
Back
Top Bottom