note 84203 added to function.preg-match
| From: | user at adherun dot com | Date: | Thu, 03 Jul 2008 08:20:41 +0000 |
| Subject: | note 84203 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-141104@lists.php.net to get a copy of this message | ||
Grâce au descriptif de cette fonction faite plus haut, j'ai pu créer une petite fonction
traitant les urls.
<?php
function check_url($url)
{
$masque_url = "/^(http:\/\/)(w{0}|{3}) \. ?[a-zA-Z0-9._-] +\.+ [a-zA-Z]{2,4}\$/i";
if(!preg_match($masque_url,$url))
{
return "Votre URL est invalide";
}
else
{
return "URL valide";
}
}
?>
Source : http://www.adherun.com/tutos-voir.php?idtt=61
----
Server IP: 195.221.21.36
Probable Submitter: 192.54.193.51
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- https://master.php.net/note/edit/84203
Del: integrated -- https://master.php.net/note/delete/84203/integrated
Del: useless -- https://master.php.net/note/delete/84203/useless
Del: bad code -- https://master.php.net/note/delete/84203/bad+code
Del: spam -- https://master.php.net/note/delete/84203/spam
Del: non-english -- https://master.php.net/note/delete/84203/non-english
Del: in docs -- https://master.php.net/note/delete/84203/in+docs
Del: other reasons-- https://master.php.net/note/delete/84203
Reject -- https://master.php.net/note/reject/84203
Search -- https://master.php.net/manage/user-notes.php