function prov($cod)
{
$href = @strpos($cod,"href",0)+5;
if ($href == "5")
{ $href = @strpos($cod,"SRC",0)+4;
if ($href == "4")
{ $href = @strpos($cod,"src",0)+4; }
}
$ugl = strpos($cod, ">",$href);
$dlina = $ugl - $href;
$text = substr($cod,$href,$dlina);
ereg("['\"]",$text,$regs);
if ($regs[0] != "")
{
$sim = strpos($text, $regs[0],0);
$sim2 = strpos($text, $regs[0],4)-1;
$http = strpos($text, "http:",0);
if ($http != "")
{
$sim = $http+6;
}
$dlina = $sim2 - $sim;
$text2 = substr($text, $sim+1,$dlina);
ereg("[/\\]",$text2,$regs2);
if ($regs2[0] != "")
{
$sim3 = strpos($text2, $regs2[0],3);
$url = substr($text2,0,$sim3);
}
else { $url = $text2; }
}
else
{
$http = strpos($text, "ttp:",0);
if ($http != "")
{
$text = substr($text,7);
}
ereg("[/\\ ]",$text,$regs);
if ($regs[0] != "")
{
$sim = strpos($text, $regs[0],8);
$url = substr($text,0,$sim);
}
else { $url = $text; }
}
return($url);
}
|