justhrun

curl_cendol.pehape

Oct 8th, 2016
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. <?php
  2.     $url = 'http://www.kaskus.co.id/thread/57ec906ea2c06e78448b457a/waaa-mimin-nyebarin-cendol-emas-di-kaskus/';
  3.     $bla = curl_init();
  4.     curl_setopt($bla, CURLOPT_URL, $url);
  5.     curl_setopt($bla, CURLOPT_RETURNTRANSFER, true);
  6.     curl_setopt($bla, CURLOPT_HEADER, false);
  7.     $result = curl_exec( $bla );
  8.     curl_close($bla);
  9.  
  10.     preg_match_all('/<img src="http:\/\/s.kaskus.id\/images\/smilies\/smilies(.*?)class="plus gp__icon"(.*?)\/>/i', $result, $smile);
  11.     unset($result);
  12.     preg_match_all('/<img src="http:\/\/s.kaskus.id\/images\/smilies\/smilies(.*?)\/>/i', $smile[0][0], $smile);
  13.  
  14.     foreach($smile[0] as $cendol) {
  15.         if( preg_match('/plus gp__icon/',$cendol) ) echo $cendol."<br>";
  16.     }
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment