diff --git a/src/Framework/Common.php b/src/Framework/Common.php index b3fbece..4474b35 100644 --- a/src/Framework/Common.php +++ b/src/Framework/Common.php @@ -49,6 +49,11 @@ final class Common return (self::getCount($data) > 0) ? true : false; } + /** + * Is the Array item or Has Keys like key=>value? + * @param array $array + * @return bool + */ public static function hasKeys(array $array): bool { return array_keys($array) !== range(0, count($array) - 1); @@ -97,6 +102,13 @@ final class Common } return false; // Empty Data..., return false } + + public static function getDigitsAndLettersOnly(false|null|string $input): ?string { + if ($input === false || $input === null) { + return null; + } + return preg_replace('/[^a-zA-Z0-9]/', '', $input); + } public static function safeFlipArray(?array $data): array {