<?php
// Mengambil Content di Situs Lain dengan file_get_contents dan Regex
// by : Loka Dwiartara
// http://www.ilmuwebsite.com
// file get.content.php.txt
$text = file_get_contents("http://jadwalsholatimsak.info/monthly.php?id=307");
echo "<table border='1'>";
preg_match_all('#<tr\sclass=\"table_header(.+?)>(.+?)</tr>#siu', $text, $result);
for ($x = 0, $jumlah = count($result[0]); $x < $jumlah; $x++) {
echo $result[2][$x] . "\n";
}
echo "</tr><tr>";
preg_match_all('#<tr\sclass=\"table_highlight(.+?)>(.+?)</tr>#siu', $text, $result);
for ($x = 0, $jumlah = count($result[0]); $x < $jumlah; $x++) {
echo $result[2][$x] . "\n";
}
echo "</tr></table>";
?>
Leave a Reply