bunu koda nasıl dökeceğim hakkında bi fikir oluşmadı hocam kafamda o yüzden sormak istedim cevap için teşekkürler.
<?php
/*
* Uygulama Örneği
*
* @author: SAINTX
* @web: http://saintx.net
* @mail: im[at]saintx[dot]net
* @date: 11.05.2013
*/
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
function html($url, $iconv=false, $iconv_in_charset='', $iconv_out_charset='') {
return ($iconv) ? iconv($iconv_in_charset, $iconv_out_charset, file_get_contents($url)) : file_get_contents($url);
}
/*
* $_GET['start_pos'] isimli verimizden hangi sayfadan başlıyacağını alıyoruz. (varsayılan; 1)
* $_GET['end_point'] isimli verimizden hangi sayfada duracağını alıyoruz. (varsayılan; 5)
*/
$url = 'http://www.mattcutts.com/blog/';
$start_pos = ($_GET['start_pos']) ? $_GET['start_pos'] : '1';
$end_point = ($_GET['end_point']) ? $_GET['end_point'] : '5';
for($i = $start_pos; $i <= $end_point; ++$i) {
$html = ($i == '1') ? html($url) : html($url.'page/'.$i.'/');
$regex_pattern = '#rel="bookmark" title="Permanent link to (.*?)">(.*?)</a></h2>#si';
preg_match_all($regex_pattern, $html, $matches);
array_pop($matches);
$matches = end($matches);
echo '<h1>'.$i.'. sayfadaki yazı başlıkları</h1>';
foreach($matches as $title) {
echo '<p>'.$title.'</p>';
}
}