Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Currently, I\'m very comfortable with building tools/web apps in an ASP.NET envi

ID: 650528 • Letter: C

Question

Currently, I'm very comfortable with building tools/web apps in an ASP.NET environment. I'm not really looking to leave tbh, as I really like C#, ASP.NET, MVC 3, Visual Studio, etc.

However, right now I know almost nothing about PHP and that seems like a deficiency that I'd like to rectify.

Are there any books (or other learning methods) that would be a good resource to learn PHP? Obviously there are plenty of beginning PHP books, but I am already comfortable with much of what is involved with building a web page, and interested in focusing on PHP itself which might not be compatible with the scope of some beginning PHP books.

I went through the PHP Manual quite a bit, and it doesn't seem to flow as smoothly as might be ideal. Is there a beginning PHP book that would be appropriate? I miss the cohesiveness that most books contain when looking through those samples. There is lots of info more, but it feels more like a reference while coding than a primary learning vehicle.

Explanation / Answer

The best resource out there to learn PHP is the PHP manual. It's extremely well written and well structured, and it's one of the biggest assets of the PHP community. If you are confident with ASP.net, the manual is enough to get you started.

Before you start reading though, you should setup a PHP stack. You can install Apache, PHP and your favorite database (SQLServer is fine) by yourself (it's extremely easy) or you could setup a ready made stack like XAMPP. XAMPP will install:

Apache,
MySQL,
PHP,
The PHP Extension and Application Repository (PEAR)
PERL
OpenSS (via mod_ssl)
SQLite
phpMyAdmin
all in one go (plus some other stuff). One important library it's missing is phpUnit, that obviously will help you with unit testing.

Then you should install an IDE, your obvious choices are Eclipse Classic with the PHP Development Tools (PDT) or Netbeans for PHP. There are a lot of others, but these two I recommend. I use them both, if you can't choose between them Netbeans is a little easier to get the hang of, but you should really evaluate both and decide for yourself which one is better for you - I haven't worked with Visual Studio in a long time and I really don't know which IDE may feel more familiar to you.

When you get over the basics from the manual, you should start thinking of an MVC framework. Again, I will recommend two:

Zend Framework, and
CodeIgniter
Zend Framework is the beast and CodeIgniter is the beauty, if you allow me a silly metaphor. Zend Framework has a steep learning curve, is backed by Zend (the company behind PHP), and you can do almost everything with it. CodeIgniter is a lot easier to get the hang of, has nice documentation for beginners and it's fairly popular. But most of it's codebase is outdated crap, as they used to support PHP4 not so long ago.

For a beginner the obvious choice is CodeIgniter, but don't get stuck with it. Use it as a learning tool and move to Zend Framework as soon as possible. Again there are a lot more MVC frameworks in the PHP world, but these two are the ones I recommend.

As for books, a great non beginner book is PHP Objects, Patterns and Practice. Sitepoint's PHP books are always a delight to read. If you fall in love with PHP you should really consider a subscription to PHP Architect.

Lastly, check out this great discussion on purely technical reasons for PHP as a first choice.

Update: A few more online resources, that mostly target non beginners:

IBM's PHP project resources
Oracle's PHP Developer Center
Zend Developer Zone
and if for some weird reason you want to play around with PHP on IIS instead of Apache, a good starting place is Microsoft's PHP on Windows. PHP on IIS works and is a valid choice especially for a .Net developer, but you should really go with Apache (and MySQL or PostgreSQL instead of SQLServer) to get the full PHP experience and also ensure that your skills are portable to any other popular OS. You don't want to miss out on the joy that is mod_rewrite.

Personal note: There's a lot of hate floating around for PHP, some of it is justified. If you do decide to go for it, you must be extremely critical of the various PHP resources, scripts, libraries you will meet along the way, there's too much crap out there and it's impossible for a beginner to know the difference. PHP's vast popularity can be translated to a very big and helpful community, large marketability of your skills, millions upon millions of blogs, but it can also be translated to a few thousand terabytes of crappy code.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote