TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How to learn PHP. php.net or books?

3 点作者 shire将近 11 年前
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?

6 条评论

saluki将近 11 年前
I recommend working through this book as a starting point: <a href="http://www.headfirstlabs.com/books/hfphp/" rel="nofollow">http:&#x2F;&#x2F;www.headfirstlabs.com&#x2F;books&#x2F;hfphp&#x2F;</a><p>If you are just getting starting with html&#x2F;css there is an html&#x2F;css book that would be a good idea to work through first.<p>The head first books will give you a good foundation in PHP, MySQL, HTML, and CSS.<p>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 . . .<p>Build a few of your apps from scratch, writing your own login system, etc (using one of the tutorials out there). It&#x27;s a good idea to write everything from scratch so you can understand what goes on behind the scenes in an app.<p>After that you&#x27;re going to want to learn a framework. For PHP I recommend Laravel. There are great screen casts at laracasts.com.<p>As far as future employment . . . I would recommend trying to pick up some freelance projects as soon as you&#x27;re comfortable with html&#x2F;css&#x2F;php. Wordpress might be a good skill to learn to get you familiar with php&#x2F;mysql uploading files and it&#x27;s php based.<p>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.<p>When you get stuck on something google for it and look for answers on stackoverflow.com.<p>That should get you moving in the right direction.
TamDenholm将近 11 年前
Use php.net like a dictionary, its not something you read from start to finish, its what you use to look things up.<p>Read a few tutorials, do a hello world script and work your way up, eg, calculator, comment thread, blog, etc.<p>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.
评论 #8033939 未加载
ohashi将近 11 年前
Definitely look at <a href="http://www.phptherightway.com/" rel="nofollow">http:&#x2F;&#x2F;www.phptherightway.com&#x2F;</a>
edoceo将近 11 年前
Every time I&#x27;ve needed&#x2F;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.<p>This goal will push you to learn many parts of the language. I&#x27;ve found it gives me a bit more drive than &quot;dry&quot; study.
akg_67将近 11 年前
A lot will depend on your background and what is your preferred method of learning. Do you learn by learning the basics&#x2F;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.<p>Below is my experience in learning PHP and launching the MVP for my personal project in six weeks:<p>I first started with the SitePoint book: Kevin Yank Build Your Own Database Driven Web Site Using PHP &amp; 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.<p>By the time I was 3&#x2F;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.<p>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&#x2F;roadblock that I couldn&#x27;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.<p>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.<p>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.<p>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.<p>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.<p>I am not a web developer or looking to become a web developer as I like sales&#x2F;pre-sales&#x2F;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&#x2F;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.
评论 #8026875 未加载
mc_hammer将近 11 年前
the website is invaluable - but i used it mostly for reference and looking up how to do something.<p>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.<p>i can also recommend irc if u have questions.<p>dayle rees code happy is a great laravel book also, and a bunch of it is available online.