
Ask HN: How to learn PHP. php.net or books? - shire
I want to learn PHP fully and be able to find a job as a Web developer in about a year. How do I get started?<p>Give me some helpful resources and how to learn the language.<p>is it better to study at http:&#x2F;&#x2F;php.net&#x2F; or grab a book on PHP web development?
======
saluki
I recommend working through this book as a starting point:
[http://www.headfirstlabs.com/books/hfphp/](http://www.headfirstlabs.com/books/hfphp/)

If you are just getting starting with html/css there is an html/css book that
would be a good idea to work through first.

The head first books will give you a good foundation in PHP, MySQL, HTML, and
CSS.

After working through those books you need to pick your own project to work on
. . . pick some type of website or simple web app that you need . . . and work
on that . . .

Build a few of your apps from scratch, writing your own login system, etc
(using one of the tutorials out there). It's a good idea to write everything
from scratch so you can understand what goes on behind the scenes in an app.

After that you're going to want to learn a framework. For PHP I recommend
Laravel. There are great screen casts at laracasts.com.

As far as future employment . . . I would recommend trying to pick up some
freelance projects as soon as you're comfortable with html/css/php. Wordpress
might be a good skill to learn to get you familiar with php/mysql uploading
files and it's php based.

Once you are familiar with php and laravel you can look for a php job using
laravel. Also consider learning Rails (Ruby Framework) as there are lots of
opportunities in Rails.

When you get stuck on something google for it and look for answers on
stackoverflow.com.

That should get you moving in the right direction.

------
TamDenholm
Use php.net like a dictionary, its not something you read from start to
finish, its what you use to look things up.

Read a few tutorials, do a hello world script and work your way up, eg,
calculator, comment thread, blog, etc.

Learn by doing, id say only read when you are trying to accomplish something
you are actually doing. Reading a book without writing any code will get you
no where.

~~~
shire
Thanks, so php.net is not a tutorial that's meant to be from start to finish
but rather just a reference?

------
ohashi
Definitely look at
[http://www.phptherightway.com/](http://www.phptherightway.com/)

------
edoceo
Every time I've needed/wanted to learn a new language I found it very helpful
to have a project in mind do this. Like, building a simple web-service for me
and my friends.

This goal will push you to learn many parts of the language. I've found it
gives me a bit more drive than "dry" study.

------
akg_67
A lot will depend on your background and what is your preferred method of
learning. Do you learn by learning the basics/fundamentals first or by walking
through a complete project and along the way picking up fundamentals? I am in
the later category learning wise and my last programming experience was using
FORTRAN on VAX systems several decades ago.

Below is my experience in learning PHP and launching the MVP for my personal
project in six weeks:

I first started with the SitePoint book: Kevin Yank Build Your Own Database
Driven Web Site Using PHP & MySQL. I read the book and coded all examples in
the book. The book walks you with building a project while introducing the
basics of PHP and SQL languages.

By the time I was 3/4th of the way with the book (took me about 5 days of 8
hours each day), I started to look for PHP framework to use while implementing
my project. After googling and reviewing what people wrote about different
frameworks and just reviewing the quick start information for each framework,
I settled on Codeigniter (CI). The reason I went with CI was its simplicity,
excellent documentation, helpful community and by just googling for anything +
codeigniter, I was able to find enough information to know that I am most
probably not going to be first one to encounter a problem not already solved
and shared online. I spent 2 days going through a quick start project on
Codeigniter website to become comfortable with the CI framework.

After a week, I just started coding my project using PHP, Codeigniter, and SQL
that I learnt from the book and just googling for information whenever I ran
into issues/roadblock that I couldn't figure out. I coded PHP and SQL portion
of my MVP in 3 weeks and then spent another two weeks learning little bit of
HTML, CSS, and Bootstrap to give MVP some eye candy.

I will suggest you pick up a project oriented PHP and SQL book and just start
building the project in the book. If you have a personal project in mind,
start outlining your personal project while going through the book.

If you are in a rush to get a personal project out the door, I will suggest
using Codeigniter framework though the future development on it has ceased. It
will get you up and running quickly and still the best documented framework
online.

If you are not in a rush, then I will suggest learning Laravel as it appears
to be the next step to CI and upcoming and new shiny thing. Personally I am
finding learning Laravel slightly difficult due to lack of project-oriented
guides. Most of the books and tutorials are just rehash of information on
Laravel site that more looks like php.net than codeigniter framework site,
community not so friendly and just lack in diversity of published information
online and in print.

Once you have got some handle on PHP, I will suggest pickup a few more books
that go into OO PHP and PHP Design Patterns.

I am not a web developer or looking to become a web developer as I like
sales/pre-sales/solution engineering roles. But recently I interviewed at a
CDN company and the interviewer was very impressed that I coded my whole
personal project. He said he has personal projects and most of them are not
even 1/10th of the size and complexity of the work I done on my project. I am
sure one year is a long time for you to become pretty good with PHP.

~~~
renzgarcia
What project oriented Python book will you recommend? Thanks.

~~~
akg_67
Sorry, I didn't really investigated project based Python books.

I considered Python/Django for another personal project recently. I started
with Adrian Holovaty, Jacob Kaplan-Moss The Definitive Guide to Django Web
Development Done Right. But I never finished the book as I decided against
using Python/Django for web development and settled on PHP/Laravel.

------
mc_hammer
the website is invaluable - but i used it mostly for reference and looking up
how to do something.

a book will help a lot, especially if you know another programming language.
the concepts wont be so strange and u can breeze through it, learn a lot, and
then use it as a reference.

i can also recommend irc if u have questions.

dayle rees code happy is a great laravel book also, and a bunch of it is
available online.

