A combination of using isset() instead of count() or strlen(), caching the chunkify function, and replacing is_numeric() with some comparisons