RahulShaw

cURL Request to invoke the api at www.decoded.cf

Nov 14th, 2015
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $url = "bit.ly/1lgjyiI";
  4. $get_request_url = "api.decoded.cf/?url=$url";
  5.  
  6.  
  7. //init curl
  8. $ch = curl_init();
  9.  
  10. //Set the URL to work with
  11. curl_setopt($ch, CURLOPT_URL, $get_request_url);
  12.  
  13.  
  14. //Setting CURLOPT_RETURNTRANSFER variable to 1 will force cURL
  15. //not to print out the results of its query.
  16. //Instead, it will return the results as a string return value
  17. //from curl_exec() instead of the usual true/false.
  18. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  19.  
  20. //execute the request
  21. $store = curl_exec($ch);
  22. curl_close($ch);
  23.  
  24. echo '<pre>', $store , '</pre>';
  25.  
  26.  
  27. ?>
Add Comment
Please, Sign In to add comment