- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
function trim_urls($urls)
{
$out = '';
$arr = explode("\n", $urls);
foreach ($arr as $v)
{
$u = strip_tags(trim(preg_replace("/:.*$/i", "", preg_replace("/\/.*$/i", "", preg_replace("/^www\./i", "", preg_replace("/^http:\/\//i", "", preg_replace("/^https:\/\//i", "", $v)))))));
if(!empty($u))
{
$out .= $u;
$out .= "\r\n";
}
}
return $out;
}
Lure Of Chaos 19.07.2012 00:06 # +1
> /\/.*$/i
но ход ваших мыслей мне нравится
Lowezar 19.07.2012 10:24 # 0
Lure Of Chaos 19.07.2012 11:22 # 0