Are you looking for an easy way to validate a user’s input? Then Stringly is for you! Are you also looking for an easy way to check if strings begin with/end with/contains a specific string? Then Stringly is for you!
Stringly helps you validate your users’ input using predefined options, which are:
URL IP EMAIL ALPHANUMERIC NUMERIC LETTER ONLY LOWERCASE UPPERCASE RANGE (a number between 2 numbers) HEX
Examples of string placement checking:
require('stringly.class.php');
$begins = Stringly::beginsWith('PHP is the web scripting language of choice.', 'PHP'); $ends = Stringly::endsWith('PHP is the web scripting language of choice.', 'choice'); $contains = Stringly::contains('PHP is the web scripting language of choice.', 'php');
More examples are found in the documentation. Examples of string validation:
require('stringly.class.php');
$url = Stringly::validate(Stringly::VALIDATE_URL, 'https://encrypted.google.com/search?q=hello');
$ip = Stringly::validate(Stringly::VALIDATE_IP, '221.15.154.26');
$email = Stringly::validate(Stringly::VALIDATE_EMAIL, 'mr@green.com');
$alnum = Stringly::validate(Stringly::VALIDATE_ALNUM, 'ben445');
$num = Stringly::validate(Stringly::VALIDATE_NUM, '345345671');
$letters = Stringly::validate(Stringly::VALIDATE_LETTERS, 'hiii');
$lower = Stringly::validate(Stringly::VALIDATE_LOWER, 'specialoo');
$upper = Stringly::validate(Stringly::VALIDATE_UPPER, '290532L');
$range = Stringly::validate(Stringly::VALIDATE_RANGE, 6, 1, 20);
$hex = Stringly::validate(Stringly::VALIDATE_HEX, '#00FFFF');
More examples are found in the documentation.