views:

1027

answers:

19

Hi.

I'm currently working as an applications developer, with a Java and C++ background, but I'd like to be able to work on more web-based projects.

I was originally thinking of learning one of the newer languages, but I suspect that there'll be more value to learning php, as that's what most legacy code's written in. Hopefully then moving on from there to the newer, cleaner technologies.

Does anyone have any advice on good ways to learn php, good beginner projects to write in php, or does anyone disagree with my suspicion completely, and have a better technology for me to start with? Thanks

EDIT: Just to be clear, the reason I want to start with a language with a large legacy codebase is so I can take a look at real-world code use, as part of my learning cycle. I find that having examples of what people do right and wrong for real-world problems is very valuable.

+5  A: 

A good way to start is to go to www.php.net and download the necessary binaries and tutorial. I started that way. the tutorial is quite detailed and has examples to go by. Also what i can assure you is that PHP is worth learning and using... let your imagination be your guide.

Steve Obbayi
+2  A: 

Hmm.

You can always start with a "hello world" application. From there I'd probably look at generating html and dealing with user input. After you have that figured out I'd look at transactional databases and using something like MySQL as a backend.

A small webpage which requires login might be a good start.

Depends where you want to go with it really, I just started playing around with a few things one day. You shouldn't find it too hard coming from a C++ background.

Cetra
A: 

I think you'd likely be safe picking up php. I have a C++ background and found picking up php and Python to be pretty painless. I typically learn best through reading books generally, and following through the examples and such. Not sure why, but that's just the easiest way for me to personally learn. As for good beginner projects, you could always do the typical blog engine or forums. God knows we need more of those. :)

f4nt
I'm a reader too. Do you have any good books you could recommend?
deworde
A: 

I guess it depends on what type of company you want to go work for.

If it is a small startup company who is in the tech sector you may be right, php and other Open Source platforms may be just what they are looking for.

My experience has always been that with larger corporations, which always want a stable, well commercially supported platform, such as .Net or Java.

There are no shortages of .Net related jobs in our area, and we are in the mid-west corn belt of america.

I don't think you can go wrong going down the Microsoft .Net route, pick your language of choice, c#, VB, F#, C++, etc.

Good Luck!

Jason Stevenson
A: 

Learning an older technologi to help support legacy code might be a way to earn a bit more cash up front, but striving to follow up on the newest technology helps you stay competitive and valuable once the legacy code starts disappearing - plus the most important part (for me atleast) - it's a heck of a lot more fun using the newest technologies and keeping up with what's moving.

Per Hornshøj-Schierbeck
+1  A: 

try http://htmlgoodies.com they have a PHP tutorial section. No, I don't own the site nor is this a spam. I use that side often when I was a newbie with PHP. It's also good to learn a framework after you've learned the basics. Personally symfony has the lowest learning curve imho.

A: 

Anyone that you ask that is a programmer is probably going to have a biased opinion to their language of choice. Take me for example, where I would recommend you should learn Ruby (and then Rails) as the code is much neater than PHP and it teaches you code conventions such as not putting all your code in one file (a habit I was in when I was a PHP developer) and how an object-orientated language works, which you may already know of from your C++ experience.

A good place to start would be the Agile Web Development with Rails 3rd edition book. Alternatively there's The Rails Way or if you're looking for something that's a bit more psychotropic, there's Why's Poignant Guide.

If you do choose to learn Rails, be aware that things are changing fairly quickly since it's a fairly new framework so you'll need to stay on top of all the new goodies and not be misled by tutorials older than about a year.

Ryan Bigg
No religious arguments about "my language is better than your language". OP wanted information on PHP, you gave him information on Ruby. That doesn't answer the question.
Jeremy Privett
+5  A: 

Get XAMPP and a good tutorial.

CMS
+4  A: 

Whenever i want to learn about web technologies, i start from w3schools.com. Here is the link for PHP tutorial:

http://www.w3schools.com/PHP/DEfaULT.asP

poh
w3schools has the cool TryIt Editor where you can mess around with code and see what happens, super nice!
MrBoJangles
A: 

This is going to get flamy :) There’s so many web projects that You can certainly find a niche with almost any technology. That is why I would pick something else than PHP to learn. Life is short and there is much more fun with other languages – I like Perl, for instance. It’s mature, it’s fun and it’s well suited to the web.

zoul
A: 

When Google devs were asked:"Where do you use php?", they answered: "Actually we use one website to order pizza in office, it's written on php"

May be you should try something like python? Anyway, if you have good experience on Java & C++ coding, take some free scripts of CMS's to look through, keeping php.net opened. I can advice this book

willson
A: 

I would just try to create a personal website and create your own little apps like a phone book or whatever just to get the hang of it. I usually learn best just experimenting

SeanDowney
+1  A: 

NETTUTS has an ongoing series that seems like a good start:

Learn PHP FRom Scratch: A Training Regimen

Week2

As someone who has been coding PHP for 5 years it seemed like a good intro, I'm currently reading a similar series on RoR

Swish
+2  A: 

Start with a good tutorial-type book to get a feel for the language, and then get a good reference book to fill in the details that the tutorial leaves out by design.

See the suggested books in this related question:

http://stackoverflow.com/questions/90924/what-is-the-best-php-programming-book

flamingLogos
A: 

My advice would be to skip the basic stuff since you are already fluent in programming. If you want to write your own framework as a way of learning then I'd do this - this is how I learnt PHP. If you aren't inclined on writing your own framework then I'd take another one (oscommerce, cakephp etc) and see how it fits together.

PHP isn't hard, its just the terrible way they've named alot of the functions and remembering them that is the hard part.

Joshua
A: 

A tip for you - after you have some of the basics down, the PHP Manual online is an excellent resource - quite possibly the best reference for any similar language. It would pay you well to spend an afternoon going through it. You don't have to read every page (I've never used Oracle or LDAP) - but I know what sort of things that are available, if I do need them, and for the common calls (array and string handling, for example), I did read them quite closely. The hard part of learning any new programming language is the libraries around it, and within it - don't spend days writing a duplicate of something already built in because you didn't know it was there.

Finally, Great developers can write great code in PHP that is clear, concise, structured appropriately and works well - but it takes discipline on your part. Keep learning your craft, and you'll be a better programmer, in whatever language you may be using today.

Alister Bulman
+1  A: 

A lot of the PHP functions (particularly string manipulation functions) are named the same as similar C functions, so if you've used C functions a lot, you should have no troubles "guessing" what you need to use.

A very nice shortcut to learn is that if you want to go directly to the documentation for a function in php, you type php.net/functionnamehere in your web browser. This will either take you directly to the function, if it exists, or perform a search for similarly named functions.

I have found this little "hidden feature" to be the single most useful thing to turn to when I'm working with PHP, especially for "function discovery".

Otherwise I suggest just trawling the official documentation for the area you're interested in, as there are lots of examples (both in the documentation itself and given by readers) that solve many common tasks.

Daniel Bruce
A: 

We are programming all our sites in PHP, but the language itself isnt really hard to learn, if you can already code in tougher languages it wont take you more than a week and then to look up functions in php.net.

WIth your background I would def. recommend .NET instead, not saying its better but you have a lot of skills for it already so why not exploit that.

Android Noob
A: 

I would recommend php tutorial. It has a lot of interesting examples