Advertisement
niammuddin

bing konten acak2

Oct 21st, 2016
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. <?php
  2.  
  3. $url = $_SERVER['REQUEST_URI'];
  4.  
  5. $kiwod = explode("/", $url);
  6.  
  7. $cinta = str_replace('.html','',$kiwod[0]);
  8.  
  9. echo $cinta;
  10.  
  11. $s = $cinta;
  12.  
  13. $rssbing  = simplexml_load_file('http://www.bing.com/search?q='.urlencode($s).'&count=10&format=rss');
  14. echo '<p>';
  15. foreach ($rssbing->channel->item as $itembing) {
  16.  
  17. echo ''.$itembing->title.' '.htmlspecialchars(strip_tags($itembing->description)).'';
  18.  
  19. }
  20. if (empty($itembing)) {
  21. echo '<small>Not Found</small>';
  22. }
  23. echo '</p>';
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement