Get started learning PHP
Someone I met the other day asked me how they could get started with PHP - should they do a course?
I don't think a course is the best way to start PHP - with so many good resources online you can get started and start writing practical PHP, and come back and use a book or do a course once you've already grasped the basics.
Tips
Make sure you understand
- the control structures like if, while, the difference between for and foreach
- most of the string manipulation functions
- print and echo and the difference between them
- some of the array manipulation functions
You will also want a really good grasp of how arrays work, it's a pretty long article but I'd read through the whole thing php.net/array . I think the biggest strength of PHP is its very flexible array implementation and understanding it well will give you a great deal of the benfits of PHP.
Once you have that covered move on to understanding the object oriented functionality that was introduced in PHP5.
Resources
Stackoverflow.com
This is a great resource for a number of languages. One of the cool things about having people who know all these different languages is they can look at something like PHP from a bunch of different perspectives. A lot of people say PHP is terrible, and they have their reasons ... But I also think that there are many cases where PHP is the best or most economically viable solution
http://stackoverflow.com/questions/309300/defend-php-convince-me-it-isnt-horrible
Some really good responses on this thread. This will give you more of a feel for the language at a bit of a higher level than the nuts and bolts of this or that function.
You can look at all the PHP threads here
http://stackoverflow.com/questions/tagged/php
php.net
Thisis the official resource. One handy thing about php.net is if you want to search for how to use strlen (string length) for example, just navigate to php.net/strlen and you will be redirected to that manual page. In the left hand column there will be a bunch of other similar functions to the one you just looked up - in this case string manipulation
phpclasses.org
This is sometimes good sometimes bad. they have a lot of resources on there but I've found some of the submitted code is unpolished. On the other hand I've used some email and graphing libraries from there and they have been fantastic.
So if you want to find a library to do something that you think might have been done before, sign up and check out this site, try things and be aware the first thing you download might not be the right tool for the job.
From time to time they also have great newsletter articles.
January 20th, 2011 - 09:08
If books is your preferred learning tool, this book has really helped me learning PHP and get started in Web Development: http://www.amazon.com/PHP-MySQL-Web-Development-4th/dp/0672329166/ref=dp_ob_title_bk