tags:

views:

292

answers:

8

I know Perl quite well, but have not worked with PHP. Any books or references that are targeted to people who know Perl and want to start using PHP?

+1  A: 

Well, you're going to be familiar with the syntax. PHP has excellent documentation. Nowadays we're trying to be object oriented so check out PHP 5 Objects, Patterns, and Practice by Matt Zandstra (Apress). It's cool.

meouw
hahaha! Edited, this post was, by brian d foy. He fixed my capitalisation. Thanks brian! :)I'm British by the way so the spelling of capitalisation is correct for me.
meouw
+2  A: 

Pear is your CPAN now.

Luca Matteis
yeah.. right ;)
Øyvind Skaar
+1  A: 

No books required. I was in the same position but I just followed some tutorials online. It is very easy to jump into it.

cbrulak
+2  A: 

If you are going from Perl to PHP, and you are looking for references that focus on this transition path, the only possible difficulty you will have is distinguishing the relevant and helpful content from the garden-variety language zealotry.

StackOverflow itself is a good site for good high signal/noise ratio content whenever you have a specific question on a function or module from Perl, and you want to know the PHP equivalent (if it exists), or if you have a question on development workflow inconsistencies between the two environments. Ask a specific question and you'll probably get a good answer or a link to where you can look it up.

For everything else, the PHP documentation (and coding time) will probably be sufficient.

For the language-comparison buffs out there, PLEAC is a pretty decent resource as well, although admittedly some of the content may seem to be a tad out of date.

dreftymac
+1  A: 

For really basic stuff like

foreach $i (@a) { .. }

translates to

foreach ($a as $i) { .. }

this could be helpful: http://www.antigreen.org/vadim/ProgLanguageComparison/perl2php.html

AmbroseChapel
+1  A: 

PHP was the first language I learned entirely from the internet. I had already written web pages so I just started inserting little PHP snippets that I found into my pages and then figuring out how they worked. Then I started to modify them and later writing my own. Now PHP is just about my favorite language. I use it for all kinds of general programming. Just jump in and go for it!

unclerojelio
+1  A: 

Read the PHP online manual, really! it's the best book on PHP you can find, it's clear, exhaustive and the user generate content (aka comments) contains a lot of useful examples of real life problems. Believe me, this is not a RTFM answer! ;)

EndelWar
+1  A: 

I found it surprisingly easy to build a few PHP sites with my background in Perl. Obviously there are differences, but the syntax has a lot in common and PHP has an extensive set of libraries as well. Regular expressions are a bit more verbose in PHP and I really missed CGI.pm at the time, but other than that it was easy to get started.

Brian Rasmussen