Author: David Sklar
PHP is not a very hip language, but it is still used to implement a lot of websites. What is really good about it is that if you need to do something difficult, like convert a gif to a jpeg and resample, then there is usually a module that will do the job.
So there is still a need for books like Learning PHP, which one imagines would take a structured apporach suitable for beginners. David Sklar has also written a PHP cookbook for OReilly and this particular book veers towards the cookbook style.
There are two ways to tackle teaching a beginner PHP. You can either emphasize the way it mingles with and works with HTML, or you can pretend that it is a pure language that just happens to bump into HTML now and again. This book takes the latter approach and if you are looking to find out how to interleave PHP with HTML in a page then you might not find it quite to your liking. It also isn't particularly suited to the complete beginner. It ramps up the level fairly fast and starts to show you how to do real world things very quickly. It is in this respect that it is more like a cookbook than an introduction.
The first chapter introduces PHP, its history and how to use it. The examples given are fairly advanced so don't be put off if you don't understand them. No particular IDE or programming environment of any kind is mentioned.
Chapter 2 dives into using strings and numbers. Not a bad place to start for the complete beginner. In this case though things get a bit more complex because PHP supports putting variables in strings. Chapter 3 and 4 deal with conditional statements, looping and how looping fits in with arrays. Again it's not just an elementary introduction - sorting and multidimensional arrays are covered.
Chapter 5 introduces functions and it goes into scope and type. Chapter 6 introduces objects, which are in many ways PHP's biggest problem as they were grafted on as an afterthought.
At this point the introduction to PHP is over and we start looking at how it can be used to achieve different tasks. Chapter 7 is about web forms - and for a beginner this is a difficult topic because it involves different HTTP requests and what happens on the client and the server. Next we jump into databases - yes vital for using PHP, but again a tough topic. From here we go over file handling - shouldn't file handling come before database? A matter of opinion.
Chapter 10 is about cookies and sessions and the next one is about HTTP and generally communicating with other websites and services. Chapter 12 is about debugging, Chapter 13 is about unit testing and Chapter 14 is on general ideas of software engineering. Then we return to the nitty-gritty of programming in PHP and look at dates and time - surely this should be earlier? Chapter 16 is about package management and Chapter 17 deals with the topic of sending email using PHP. It is all a bit too mixed up and random without a steady progression of ideas.
Chapter 18 deals with the important topic of frameworks and covers Laravel, Symfony and Zend. I think that if you are contemplating using a framework then you should also consider some of the many PHP CMSes like WordPress, Drupal, Joomla and so on, but these aren't mentioned.
Chapter 19 introduces the idea of creating command line PHP programs and even using PHP's built-in web server. This is a topic that is mostly ignored. The final chapter covers the more important topics of internationalization and localization. It doesn't cover Unicode, however.
This isn't a book for the complete beginner. It isn't a suitable book if you don't know about HTML, CSS and HTTP. This is as much a problem of modern web development as it is this book. You have to master so many things and see how it all fits together.
The book is more suitable if you can program and have some idea about clientside development and want to find out what happens on the server. In this case the book is more like a cookbook of topics with a few initial chapters on the basics of the PHP language. You might also find that it isn't clear on the differences between PHP and other languages, i.e. on what makes PHP special which is its close relationship to the HTML in a page. On this topic It doesn't explain how PHP can work with the HTML to create more complex and responsive user interfaces. It really is more about client/server interactions using forms and databases.
If you are a beginner you will find this book tough going. If you are an experienced programmer it might help.
|Last Updated ( Sunday, 14 April 2019 )|