Witam. Chciałbym napisać kod w php, który pozwoli wyświetlać ostatnią informację dodaną na http://www.2lo.chojnice24.pl/ na mojej stronie.
Proszę o pomoc.
<?php $ch = curl_init("http://www.example.com/"); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); ?>
<?php // Create a stream 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "Cookie: foo=bar\r\n" ) ); // Open the file using the HTTP headers set above $file = $file[1]; $file = $file[0]; $adres = $file[0]; $adres = str_replace('<a class="news" href="', '<a target="_blank" href=http://2lo.chojnice24.pl"', $adres); $tytul = $file[0]; $data = $file[0]; $data = "$data[2].$data[1].$data[0]"; $tresc = $file[0]; echo "<p class=\"naglowki1\">$adres$tytul</a></p><p class=\"data1\">$data</p><p class=\"tekst1\">$tresc</p>"; ?>