tobitaz

kamus.php

Jun 13th, 2021 (edited)
228
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $perkataan = "encik";
  4.  
  5. $url  = "https://prpm.dbp.gov.my/Cari1?keyword=".$perkataan;
  6.  
  7. $kamus = file_get_contents($url);
  8. preg_match('/<div class="tab-pane fade in active" id="1">(.*?)<\/div>/s',$kamus,$maksud);
  9.  
  10. foreach($maksud as $phc)
  11. {
  12. $atom.=$phc.PHP_EOL;
  13. }
  14. $atoms = str_replace(".&nbsp;", "", strip_tags($atom));
  15.  
  16. if($atoms !== null)
  17. {
  18. echo $atoms;
  19. }
  20. else
  21. {
  22. echo "perkataan tidak dijumpai";
  23. }
  24.  
  25. ?>
RAW Paste Data