note 103649 added to function.filter-var
| From: | YousefIsmaeil at osu1 dot php dot net | Date: | Tue, 26 Apr 2011 10:18:07 +0000 |
| Subject: | note 103649 added to function.filter-var | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-179154@lists.php.net to get a copy of this message | ||
<?php
/**
* By Yousef Ismaeil - cliprz@gmail.com
* filter url with regex
*/
function check_url($url)
{
$pattren = "|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i";
if (preg_match($pattren,$url))
{
return true;
}
else
{
return false;
}
}
// used
if (!check_url("hddp://w.3.a"))
{
echo 'this is not url';
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 178.53.247.172
----
Manual Page -- http://www.php.net/manual/en/function.filter-var.php
Edit -- https://master.php.net/note/edit/103649
Del: integrated -- https://master.php.net/note/delete/103649/integrated
Del: useless -- https://master.php.net/note/delete/103649/useless
Del: bad code -- https://master.php.net/note/delete/103649/bad+code
Del: spam -- https://master.php.net/note/delete/103649/spam
Del: non-english -- https://master.php.net/note/delete/103649/non-english
Del: in docs -- https://master.php.net/note/delete/103649/in+docs
Del: other reasons-- https://master.php.net/note/delete/103649
Reject -- https://master.php.net/note/reject/103649
Search -- https://master.php.net/manage/user-notes.php