litto / utilities
Custom Functions for Generating slugs,passwords,parse string
v1.0
2022-02-07 06:02 UTC
Requires
- php: >=5.0
README
Custom Functions for Generating slugs,passwords,parse string.etc.
##How to Install?
You can install by running command in composer composer require litto/utilities:v1.0
How to use?
Initialize Class Utilities by calling:-
$obj=new Utilities(); $encodedstr=$obj->encode($str);
Call each Function define in the Utilities Class like this. Below are some of functions available.
- getRandom() - get random string using current timestamp
- getExtension($string) - Get extension of the file you pass into this function
- setPattern($array) - Set pattern for Filter Function
- filterChars($string) - Filter chars from string
- dateDisplayFormat($date)-Convert Date to M-d-Y Format
- dateTimeDisplayFormat($date) - Convert date time to M-d-Y H:i:s format
- dateInsertFormat($date) - Convert date time to database date format for saving
- encodeString($string) - Encode your string
- decodeString($string) - Decode your string
- priceFormat($price) - Convert to price format for display
- addFilter($string)- Filtering string
- encode($originalStr) - Password Encode
- decode($decodedStr) - Decode Password
- littoformattitle($text)- Generate slug variable passing string
- getBaseUrl()- get base url of project