Quality Themes, Quality Support

Advertisement

Posts Tagged ‘functions’

10|05

How to Include All Your Functions In 3 Lines of Code

Functions are amazing. Working with huge function files is not.

I like to group all my functions into different “function files” to keep everything nice and clean. For example, I’ll keep all my functions that clean up various strings or elements in a clean.php file.

This is great because I don’t have to scan a 50000 line PHP file to find the function that I’m looking for.

As your application grows, the number of function files may grow with it. This can pose a problem. Did you remember to include the new function file in all necessary scripts?

Continue reading

09|30

Partially Functional

PHP functions can be extremely useful if you have a chunk of code that you plan on using multiple times in your scripts. Functions keep everything all neat and tidy and in the case you have to make a change, you only have to edit one place instead of multiple places.

Continue reading