1 2 3 4 5 6 7 8 9
| <?php
function verif_info($item){
if((preg_match('(([^/])www\.|(^www\.))((:alnum:|[-\%\.\?\=\#\_\:\&\/\~\+\@\,\;])*)',$item))||(preg_match('((([<a href="ftp://])|(http(s?)://))((:alnum:|" target="_blank">ftp://])|(http(s?)://))((:alnum:|</a>[-\%\.\?\=\#\_\:\&\/\~\+\@\,\;])*))',$item))|| (preg_match('/^(.+)@(.+)\.(.+)$/', $item))||( preg_match('/([0-9\+\- ])/', $item))){
$err='Vous ne pouvez pas mettre d\'adresse à cette section(numero, email et adresse web)';}
else{
$err='succes';
}
return $err;
} |
Partager