Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
@bg17aw they're more than welcome to use that code if they so choose. However, many newcomers to programming don't realize that there are many libs/tools out there that are built specifically to deal with what they are trying to do, mitigating the need to re-invent the wheel. Symfony's Validator is but one example that I'm familiar enough to vouch for which would handle all of the checking that they are doing manually and have probably already handled all of the edge cases we normally would overlook. They are more than welcome to search for their own library.
@bg17aw I'm not against any web framework, Symfony just happens to have easy to use decoupled components that can be used outside of the framework itself. The Validator component I linked to just removes the need for all of those "if param exists and has format" checks littered throughout the code.
I think for a beginner it makes a lot of sense to use one actually. You'll be thrust straight into learning best practices, including OOP, from the start just by looking at their code/docs and building a system around it. I'd choose Laravel to start with personally. It may seem heavy but as you gain more experience you'll come to appreciate what it does for you. The other advantage is that you get to spend more time building cool features vs just trying to deal with basic web framework issues which have already been solved 1000 times over in PHP.