- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
function uri_fix($url) {
/* clean protocols & prefixes */
$url = str_replace('https://', '', $url);
$url = str_replace('http://', '', $url);
$url = str_replace('ftp://', '', $url);
$url = str_replace('www.', '', $url);
/* clean all bad simbols : explode in two steps & check domain level, return only clear second level domain */
$url = explode('/', $url);
$url = preg_replace('/[^a-zа-я0-9-.]+/is', '', $url[0]);
$status = 'L1';
$domainLevel = explode('.', $url);
if ( !isset($domainLevel[3]) ) {
if ( isset($domainLevel[2]) ) {
$url = $domainLevel[1] . '.' . $domainLevel[2];
$status = 'L2';
}
} else {
$status = 'ERR';
}
$domainStatus = array('DOMAIN', $url, 'www.' . $url, $status);
return $domainStatus;
}
Комментарии (0) RSS
Добавить комментарий