- file_get_contents: documentation ( source)
- preg_match_all: documentation ( source)
<?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://www.pkpu.or.id/adzan.php?id=83");
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>";
?>