Skip to content

Latest commit

 

History

History
71 lines (44 loc) · 1.53 KB

README.md

File metadata and controls

71 lines (44 loc) · 1.53 KB

String operation collection

StrOpColl is a PHP class which contains functions for common string operations.

Instanceing the class is not necessary because the functions are static.

Functions

isStringContainNumber

isStringContainNumber(string $stringToCheck): bool

Finds whether the given string is contain number.

isStringContainLowercase

isStringContainLowercase(string $stringToCheck): bool

Finds whether the given string is contain lowercase.

isStringContainUppercase

isStringContainUppercase(string $stringToCheck): bool

Finds whether the given string is contain uppercase.

checkStringLength

checkStringLength(string $stringToCheck, int $minLength, int $maxLength): bool

Decides whether the given string is lower than given minimum and greater than the given maximum.

isStringEmail

isStringEmail($stringToCheck): bool

Finds whether the given string has email format.

isStringsAreEqual

isStringsAreEqual(string ...$strings): bool

Finds whether the given strings are equal.

generateRandomString

generateRandomString(int $stringLength, bool $caseSensitive = false, bool $specialChars = false): string

Generate a random string with the given length. Containing lower and uppercase letters or special characters are optional.

encryptWithSalt

encryptWithSalt($stringToEncrypt, $salt):string

It concatenate the given string and the given salt then encrypt the result with using sha512 and md5 algorithm.