This is probably the most asked question in PHP, but where is the best resource for learning online. Wherever i go, im finding out of date code/tutorials etc. Looking for something thats worth investing time into.
The best resource for learning online is the official PHP website: http://php.net/manual/en/ Give it a look.
I strongly believe W3Schools|http://www.w3schools.com/php/default.asp is the best source of learning specially for beginners as it has lot of stuff like explanation of each item including examples as well as quizes/tests etc. If you will be done with W3Schools then go to PHP.Net to get a professional touch and after that there are many many forums like DP which can help you in your problem solving.
It's not important what will be the first PHP book. Take the first recommended from Google search. Even youtube videos will do. After first book - just practice and manuals.
Once you learn the fundamentals of programming in general it's relatively easy to pick up another language. Unless functions have been depreciated any tutorial for the language should be able to get you started then you can use the PHP.net site as a reference.
While I agree with @NetStar, mostly, I'm not really agreeing with the statement about any tutorial - a LOT of tutorials use deprecated functions like mysql_, and if you start using that it's often hard to convert to better standards.
<snip> That alone is reason enough not to read your post any further, as you clearly don't know enough on the topic to be flapping your gums about it. W3Fools is a steaming pile of outdated crap that has somehow sleazed along for a decade and a half through search engine trickery, pretending to be something they are not, and generally blowing so much smoke up nube's asses I could chop a greenhorn who's fallen for their tripe up with a butchers knife, stick it in a styrofoam tray to win a BBQ competition. @billzo has it right, go to the ACTUAL MANUAL FOR THE LANGUAGE, not some sleazeball fly-by-night whorehouse filled with misinformation, bad practices and worse advice!
I agree with deathshadow, w3schools is so out of date... better use the manual, or check forums and ask questions. PHP changed so much in the last couple of years and there are lot of functions that you should avoid!!!
Our developers believe that php.net ist a great resource. For many developers it is not important to know the exact usage of every command or function, but to know, what functions can be used at all. Many times, a function is available for a task that others create an individual function for. php.net has the advantage that they cross-link all functions to others, so that developers can quickly find what they really need.
And there I was thinking that most asked question about PHP was "what were the format codes for date() that I used last time?"
Personally, I thought the most asked question would fall along the lines of "I've taught myself PHP, but recently I read something about mysql_ not being safe, and now I've converted everything to mysqli_, but [this] and [that] person says my code is still bad - I don't believe them, so could you please have a look? [pastes in 500 lines of code, WITH password and link to database]"