Last active
December 1, 2018 16:17
-
-
Save 333crist/d9b128f9e5d29678cb7c35d7dbed2a17 to your computer and use it in GitHub Desktop.
Grabbing Content kristiandes.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// URL TARGET | |
$url = 'http://blog.kristiandes.com/grabbing-jadwal-bola-hari-ini/'; | |
//end | |
// get / mengambil content berdasarkan url yang akan di curi datanya | |
$content = file_get_contents($url); | |
// | |
// STEP 1 mengambil syntax pembuka | |
$first_step = explode( "<table border='1' class='mainhati'>" , $content ); | |
// | |
// STEP 2 mengambil syntax penutup | |
$second_step = explode("</table>" , $first_step[1] ); | |
// | |
// Replace syntax </tbody> dengan </tbody></table> | |
$text1 = $second_step[0]; | |
//Tampilkan | |
echo $text1; | |
?> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment