Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've dabbled with PHP for a few years now and I'm capable of most of the basic things, building login forms etc but from my time on here I've noticed there's so much more I need to learn, like best practices, security issues etc and so I want to learn everything from the very basics.

In the past I've used forums and browsed the web for snippets of code only I think this has led to my bad practices, can anybody recommend books or Valid, recommended learning sources?

Thanks in advance!

share|improve this question

migrated from stackoverflow.com Jun 25 '11 at 6:13

This question came from our site for professional and enthusiast programmers.

closed as not constructive by Mark Trapp Dec 15 '11 at 17:54

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

add comment

7 Answers

up vote 2 down vote accepted

phpsec.org - Take a look at their articles and their Library

Lynda.com have good tutorials on Object Orientation, Advanced Techniques, etc.

I find Apress Publishing's PHP books very good quality.

Nettuts.com has some free tutorials that are really good.

In all, books are the way to go for you, for the moment.

After you've seen the examples, you can start yourself a small in-house application or a small application framework or try to clone a website, to practice what you have learned.

After you have practiced on your own, you can start looking for tickets that challenge you, in open source projects.

share|improve this answer
add comment

Like with anything you want to learn, get someone better at it than you to help you, by looking at your code and suggesting improvements. Getting involved in an Open Source project is probably the best way to do this, or try answering questions about PHP on here, and see what feedback you get from the PHP community on here.

share|improve this answer
Regarding answering questions on here. It has helped me improve no end. Also trying to answer questions on areas that you aren't completely comfortable with yourself helps expand your horizons, especially when you are stuck in your own coding rut. –  sabre Jun 24 '11 at 10:24
add comment
  • Take a highly rated, open source project and look at how they perform the security, ORM and anything else you wish to learn. You can then take this and implement with your own ideas. You may even want to take a look into frameworks such as Codeigniter or Zend Framework - both of which are very extensive and impressive.

  • I would highly recommend learning OOP if you haven't already!

  • Get involved with the SO community, answer questions and make sure you ask some if you're unsure of the "best practice" when creating something.
share|improve this answer
OOP Is definately something I need to look into, I've also heard PDO being thrown around a lot on SO, is this similar? Thanks for the reply –  Liam Jun 24 '11 at 10:31
PDO basically provides a collection of methods which provide the ability to query a datasource (e.g. MySQL). I really do recommend using it over the standard mysql_connect,mysql_query etc. –  Prisoner Jun 24 '11 at 10:48
So when its described as a 'data layer' is that just because it sits between the code and the db? Sorry if this sounds very naive –  Liam Jun 24 '11 at 11:13
You could describe it as that. Read up on en.wikipedia.org/wiki/Data_access_layer –  Prisoner Jun 24 '11 at 11:15
add comment

When I was at the same stage where you are now, I took books which lead you step-by-step through real world (-like) projects in tutorial way: - photo gallery - mini-social community site - web shop ... and so on.

The real advantage is that though these projects you will find working solutions for challenges that you will meet and - normally - good practices. Generally these projects offer an understanding how login, authentication, shopping cart, file submission, validation, AJAX, admin site, simple pagination, database access (db layers, ORM, etc.), OOP work.

If you pass through more books, more approaches and practices you learn. Then you can adjust this knowledge for you own needs.

I prefer step-by-step tutorials and writing code, but it is personal preference.

If you decide on books, read the description what it offers (i.e. "...in this book we are going to build a webstore from scratch").

Good luck with programming!

share|improve this answer
add comment

have a look at these books they are few of the best PHP books

PHP for the Web: Visual QuickStart Guide (4th Edition)

PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)

PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)

Murach's PHP and MySQL (Murach: Training & Reference)

If you like I have these books at my disposal I can email them to you if your interested. here's my email to contact me:azdrian19@yahoo.com

share|improve this answer
add comment

Learn one of the many php frameworks. cakePHP is my recommendation.

share|improve this answer
add comment

Learn a Framework, forget the rest. It's to hard so make a secure application with vanilla PHP.

Go for CodeIgniter and begin your project.

share|improve this answer
add comment