Forum Moderators: coopster
Sorry I am disturbing again.
I am connecting and getting all datas from meteorology address but I am wishing to get only 5 lines .
Forexample,this address has 500 lines and I am wishing
to get only 5 lines (from 385 to 390).
Could you please help me?
Which command I can add to following code?
Thanks advance your kind helps.
Brgds
armator
+++
code
+++
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Meteo</title>
<?
if (!$kategori_haber) $kategori_haber = array("haber");
$satir = file("http://www.domain.com/meteo.php") or die("Serverla ileti?im sa?lanamady!");
print "${'$yazi'}";
for ($x = 0; $x < sizeof($kategori_haber); $x++) {
for ($i = 0; $i < 10; $i++) {
if (trim($satir[$i]) == "+$kategori_haber[$x]") {
$bas = $i;
break;
}
}
for ($i = $bas; $i < 180; $i++) {
if (substr($satir[$i], 1, 1) == "+" ¦¦ $i ==179) {
$son = $i;
break;
}
}
for ($i = $bas; $i+1< $son; $i++) {
$yazi = trim($satir[$i]);
$yazi = ereg_replace ("http://www.domain.com/meteo.php","http://www.domain.com/meteo.php",$yazi);
if ($yazi!= "-" &&!eregi("$kategori_haber[$x] Ön Sayfa", $yazi)) {
$yazi = str_replace("http://www.domain.com/meteo.php "," ", $yazi);
$yazi = str_replace("http://www.domain.com/meteo.php"," ", $yazi);
$haber_e = explode("¦", $yazi);
$haber_e = explode("table", $yazi);
echo "<b>$haber_e[0]</b>" ;
echo "\n";}
}
}
?>
</html>
$contents = file_get_contents('http://example.com/weather.html');
$array = explode("\n", $contents);
if(count($array) > 389){
for($i = 386; $i < 392; $i++){
echo $array[$i];
}
}
Thanks your kind interest and helps.
I added your command and it is running now.
Kindly note this address contains xmlns.
Could you please tell me how I can change font sizes and how I can remove or disable border of this addres without css that I tried to change by str_replace but I could not.
Thanks advance your kind interest and helps.
Best Regards
armator