Tyrsson
Active Coder
For those new to php. You might want to take a day or two and read this:
phptherightway.com
Here's a short list of do's and don'ts
PHP: The Right Way
An easy-to-read, quick reference for PHP best practices, accepted coding standards, and links to authoritative PHP tutorials around the Web

Here's a short list of do's and don'ts
- Use composer, and its autoloader.
- Use a good DBAL for database access.
- Don't put your queries in the same files that contain your markup.
- Don't mutate globals. Use psr-7/15.
- Use a bootstrap file and keep your executables out of the document root of the web server.
- Learn OO, its powerful.
- If your version of php supports it, use declare(strict_types=1) and if it doesn't, upgrade your php version.
- Do not reinvent the wheel. If there is a well maintained lib, use it.
- Stay out of the global scope.
- Build to the interface.
- Did I mention learn OO?
- Do NOT use eval.
- Do not try to write your own cryptography functions/methods. There is a 99% chance it's a bad idea.
- Even if you just have to use functions instead of classes and methods, please, for the love of everything good in the universe. Type your arguments and returns.
- Depend on the abstraction not the concrete implementation.
- Generally prefer composition over inheritance.