Advertisement
pusatdata

PHP Grab Data MFDOnline

May 24th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <?php
  2. $grab =file_get_contents('http://mfdonline.bps.go.id/master/cetak/cetak_desa.php?idprov=21&idkab=01&idkec=010') ;
  3.  
  4. $start = '<table width="400" border="0" align="left" cellpadding="1" cellspacing="2">';
  5. $end = '</form>';
  6.  
  7. $startPosisition = strpos($grab, $start);
  8. $endPosisition = strpos($grab, $end);
  9. $longText = $endPosisition - $startPosisition;
  10. $result = substr($grab, $startPosisition, $longText);
  11. $result = $result;
  12. echo $result;
  13. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement