mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-02-16 10:40:57 +00:00
first commit
This commit is contained in:
30
core/func/validation.php
Executable file
30
core/func/validation.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Функции для валидации данных
|
||||
*
|
||||
* @author Zmi
|
||||
*/
|
||||
|
||||
|
||||
function IsValidEmail($email)
|
||||
{
|
||||
return filter_var($email, FILTER_VALIDATE_EMAIL) !== false;
|
||||
}
|
||||
|
||||
function PhoneFilter($phone)
|
||||
{
|
||||
return preg_replace("~[^\+\*|^0-9]~is", '', $phone);
|
||||
}
|
||||
|
||||
function IsValidPhone($phone)
|
||||
{
|
||||
$phone = PhoneFilter($phone);
|
||||
return strlen($phone) > 5;
|
||||
}
|
||||
|
||||
function IsValidUrl($url)
|
||||
{
|
||||
return filter_var($url, FILTER_VALIDATE_URL) !== false;
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user