| 1 | <?php |
||
| 5 | class PhpUtilities |
||
| 6 | { |
||
| 7 | /* |
||
| 8 | * ================ |
||
| 9 | * String Functions |
||
| 10 | * ================ |
||
| 11 | * */ |
||
| 12 | /** |
||
| 13 | * isStringEnglish will check the input string is in english or not |
||
| 14 | * @param $str |
||
| 15 | * @return bool |
||
| 16 | */ |
||
| 17 | public static function isStringEnglish($str): bool |
||
| 24 | /* |
||
| 25 | * ================ |
||
| 26 | * String Functions |
||
| 27 | * ================ |
||
| 28 | * */ |
||
| 29 | |||
| 30 | /* |
||
| 31 | * ================ |
||
| 32 | * Number Functions |
||
| 33 | * ================ |
||
| 34 | * */ |
||
| 35 | /** |
||
| 36 | * parseNumber will get input as value as string or number and return float or integer number |
||
| 37 | * @param $value |
||
| 38 | * @return float|int |
||
| 39 | */ |
||
| 40 | public static function parseNumber($value) |
||
| 44 | |||
| 45 | /** |
||
| 46 | * getPercentageAmount will get input as amount & percentage as number and return percentage amount |
||
| 47 | * @param $amount |
||
| 48 | * @param $percentage |
||
| 49 | * @return float|int |
||
| 50 | */ |
||
| 51 | public static function getPercentageAmount($amount, $percentage) |
||
| 55 | |||
| 56 | /** |
||
| 57 | * getAmountPercentage will get input as amount & total as number and return amount percentage |
||
| 58 | * @param $amount |
||
| 59 | * @param $total |
||
| 60 | * @return float|int |
||
| 61 | */ |
||
| 62 | public static function getAmountPercentage($amount, $total) |
||
| 66 | |||
| 67 | /* |
||
| 68 | * ================ |
||
| 69 | * Number Functions |
||
| 70 | * ================ |
||
| 71 | * */ |
||
| 72 | } |
||
| 73 |