Skip to content

Instantly share code, notes, and snippets.

@333crist
Last active December 1, 2018 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 333crist/d9b128f9e5d29678cb7c35d7dbed2a17 to your computer and use it in GitHub Desktop.
Save 333crist/d9b128f9e5d29678cb7c35d7dbed2a17 to your computer and use it in GitHub Desktop.
Grabbing Content kristiandes.com
<?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