<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>Времето в България и Европа</title>
</head>
<body>
<div style="display:block; width:950px; margin:0 auto;">
<div style="float:left;">
<h1>Времето в България</h1>
<object width="460" height="305" type="application/x-shockwave-flash" data="http://www.btv.bg/flash/weather-bulgaria.swf" style="visibility: visible;">
<param name="menu" value="false">
<param name="wmode" value="transparent">
<param name="bgcolor" value="#FF0000">
<param name="flashvars" value="xmlfile=http://www.btv.bg/weather_service.php">
</object>
</div>
<div style="float:right;">
<h1>Времето в Европа</h1>
<object width="460" height="305" type="application/x-shockwave-flash" data="http://www.btv.bg/flash/weather-europe.swf" style="visibility: visible;">
<param name="menu" value="false">
<param name="wmode" value="transparent">
<param name="bgcolor" value="#FF0000">
<param name="flashvars" value="xmlfile=http://www.btv.bg/weather_service.php">
</object>
</div>
<div style="clear:both;"></div>
<?php
ini_set('user_agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9');
function GetBetweenElement($content, $start, $end, $element=0){
if(empty($element) || is_null($element))
{
$r = explode($start, $content);
if (isset($r[1])){
$r = explode($end, $r[1]);
return $r[0];
}
return '';
}
else
{
$r = explode($start, $content);
if (isset($r[1])){
$r = explode($end, $r[$element]);
return $r[0];
}
return '';
}
}
$url = file_get_contents("http://btv.bg/weather/");
$str = GetBetweenElement($url, '<div class="placeholder" id="divpl2">', '</div>');
echo '<div>'.strip_tags($str,'<p><br><br />').'</div>';
?>
</div>
</body>
</html>