We know that every php frame work have a helper file and this file contain lot of global function to help to make easy our web developing. Even the most popular cms wordpress has many helper function to make easy.
We can create a helper library function when we develop with non-framework php. It is very easy make a php file named helper or any name you like. Now write your necessary function in it and include it to your common header file.
Now call function from any where your project it will work properly. Overall it make your programming easier.