• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Learning PHP, I'm stuck

Lucas

Well-known member
#1
I've been for years trying to focus my mind on learning PHP in-depth and haven't been able to grasp it. For years I've started learning a couple of books and wasn't able to finish them, although I understand most of the basics such as fors, whiles, switch, functions, methods, etc. I can't understand the idea of building the program from 0.

I'm thinking of retaking some books and reading them slowly and in-depth and hopefully grab an idea from there. Any other recommendations? I think I'm ultimately lacking is some motivation, I'm one of those people that love going right to the practice although that's not always the best. I'm worked for several years on linux, apache, servers, etc. but not directly programming any php apps.

Edit: I'm starting to read this book:

Learning PHP, MySQL, JavaScript, and CSS: A Step-by-Step Guide to Creating Dynamic Websites
Author: Robin Nixon
Publisher: O'Reilly Media, Inc.
Release Date: 13-Aug-2012
 

Digital Doctor

Well-known member
#2
I'm one of those people that love going right to the practice although that's not always the best.
Then reading a book isn't for you.
Is one of your goals to make a Xenforo addon ?
If it is ... clarify an addon you would like to make. Not super huge. Just make sure you lay out what you want to do as specifically as possible.
Once a goal is set ... learn what you need to accomplish that goal.
It makes learning more relevant ... and it mimics the process you'll need to go through when you do the next project.

The process is called problem-based, self directed learning.

Of course, in the age of php forums, asking clear questions to get guidance can be very time productive.

Nicer coders here are more than willing to provide guidance (Chris Deeming, etc.).

It also helps alot to look at code. Look at a few of Chris' smaller addons. See what goes into it. (... maybe even ask Chris about specific lines of code and why they work ... he might not be able to hold your hand but he might tell you want chapter to read !).

Hope that helps
 

we_are_borg

Well-known member
#3
Lynda.com has a tutorial online called "PHP With MySQL Essential Training" learned a lot of that video. If you can follow the video the books become more understandable and easier to read. I to had the same problem that books did not work but now its a bit easier.
 

s.molinari

Well-known member
#4
Nice tips. I find the "set your goal" type of learning the best way too. Although, if you want to learn more about concepts, then books (and good Internet articles, videos, tutorials, blogs, etc.) are the best way to start. And for the most part, concepts are what you need first to understand the details like how to program in PHP. For instance, if you just dive into PHP and don't understand the basic concepts of the Internet and how web servers work with their clients (browsers, apps for mobile devices, etc.), then programming a php script is going to be a mighty big, and most likely, frustrating task. So read books for understanding the concepts, then get down to the nitty gritty like DD says, by making yourself some goals of what you'd like to accomplish and dig in further from there.

And for sure, definitely don't be too hard on yourself, when you read a book from start to finish and still can't do what you intended to learn, before you started reading the book. In 99.9% of the cases, that will never happen.:)

Scott
 
#6
you might also try www.LVSOnline.com lots of great hands on... I am taking a class now on Java Script..

Here is an example from basics
View attachment 40987
That is a horrible tutorial. Who uses BGCOLOUR? You should use inline instead of that - style="".

But, I would much much rather use external
style.css
Code:
body
{
background: red;
}
w3schools is better resource. Amazing tutorials and they _kinda of_ follow up-to-date web standards.
 

Jason

Well-known member
#7
That is a horrible tutorial. Who uses BGCOLOUR? You should use inline instead of that - style="".

But, I would much much rather use external
style.css
Code:
body
{
background: red;
}
w3schools is better resource. Amazing tutorials and they _kinda of_ follow up-to-date web standards.
W3School is terrible. A lot of their information is either out-of-date or plain inaccurate. To this day, there are still PHP examples that have open SQL injection vulnerabilities. It doesn't help that most people will assume a lot of the examples they show are best practice, and copy & paste them.

W3Fools is pretty much a rant page, but it's at least a good start http://w3fools.com/#what-should-be-done

For PHP, http://www.phptherightway.com/ is a pretty good resource.
 

meSingh

Active member
#8
If you have got a basic understanding of php and helper functions then i will suggest you to stop reading any more books and start exploring. Start with creating small set of codes and then go for big.

Here are a few examples you can start with:
  • Create a small script that takes a 2 inputs from user and then check if they match
  • Now make it to store the data added by user in a text file
  • Now make it to check if a data already exist in that text file
Just keep exploring and try different scripts then try to create anything you see on web. In case you need any help or not getting how to do particular thing, try searching over stackoverflow.com else just post it here. I am sure someone will get you an answer in seconds.

This is how i started and still doing. So far it has been really good for me and hope this also makes some difference for you too :)
 

Brent W

Well-known member
#9
Lynda.com has a tutorial online called "PHP With MySQL Essential Training" learned a lot of that video. If you can follow the video the books become more understandable and easier to read. I to had the same problem that books did not work but now its a bit easier.
I just signed up today and will start that soon
 
#10
I've also been doing the w3schools.com free lessons. They have html/css/php/javascript/jquery/etc. tutorials, sample files, quizzes, etc. Even have their own mini-compiler to show the results of basic code. A bit more interactive than a book.

I'm also going through the Learning PHP, MySQL, JavaScript, and CSS book that you mentioned in the OP too though. It's not bad.

Lastly, I'd say a good IDE helps with learning too, especially with things like auto-complete. I've researched/tested a lot and phpstorm is the best to me. Or if you like a simpler text editor type then Sublime Text is very popular.

Find some good sample code and then try and reverse engineer it to figure out how it works.
 

Brent W

Well-known member
#13
I've also been doing the w3schools.com free lessons. They have html/css/php/javascript/jquery/etc. tutorials, sample files, quizzes, etc. Even have their own mini-compiler to show the results of basic code. A bit more interactive than a book.

I'm also going through the Learning PHP, MySQL, JavaScript, and CSS book that you mentioned in the OP too though. It's not bad.

Lastly, I'd say a good IDE helps with learning too, especially with things like auto-complete. I've researched/tested a lot and phpstorm is the best to me. Or if you like a simpler text editor type then Sublime Text is very popular.

Find some good sample code and then try and reverse engineer it to figure out how it works.
http://w3fools.com/
 

Lucas

Well-known member
#15
Lot of great suggestions in here I have to say, thanks for the feedback guys. I'm debating whether to create just some simple php app or try and create a simple XenForo addon. I'd think it'd be much more motivating actually being able to use whatever you end up building.