Often when coding an application in PHP,
we write functions to solve a specific problem at time while keeping in
mind that the solution can benefit other parts of the code as well.
Repetition of a code block reduces the efficiency of your program and
makes it bloated. Check out this blog and know more about: Tips for Building Large-scale Applications in PHP