2 ms·
I have a similar dilemma with some of my helper functions. For example, I have starts_with(), ends_with(), and contains() for super easy string comparisons, is_
by kijin 14y ago
I have a similar dilemma with some of my helper functions. For example, I have starts_with(), ends_with(), and contains() for super easy string comparisons, is_between() for numerical comparisons, and custom implementations for a few built-in functions such as hex2bin() that don't exist in older versions. These are so general in scope that it would be awkward to place them in their own \Namespace\Class.
- rmrfrmrf 14y agoI'd probably break them all down into classes based on function (EasyString, EasyNumber, BuiltIn). namespace App\Library; class EasyString { public static function starts_with(); ... } and then just use them like this: use App\Library\EasyString as ES; along with an autoloader.
- deleted 14y ago[deleted]