Many web developers consider PHP as a second class language. The truth is, as DHH puts it: "You can build the best web application in the world with any language you want".
We are here not to start a religious war but to help beginner PHP developers get better. Here is the some of the best advice from season PHP programmers.
Get into the habit of commenting your code thoroughly from the outset, your future self will thank you https://www.phpdoc.org/
Ignore any online tutorials, stack-overflow solutions or any other PHP code snippets on the internet that are older than 3 or 4 years (use Google's advanced search date tools to filter out older content). PHP had evolved dramatically in the last few years, and much of what is out there is wrong, insecure and bad practice.