Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. $stack = array("par1","par2", "par3","par4");
  2.  
  3. foreach ($stack as $prof){
  4. echo $prof , '<br>';
  5. $url = "http://www.myservice.eu";
  6. $ch = curl_init();
  7. curl_setopt($ch, CURLOPT_URL, $url);
  8. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  9. curl_setopt($ch, CURLOPT_POST, true);
  10. curl_setopt($ch, CURLOPT_POSTFIELDS, $prof);
  11. $output = curl_exec($ch);
  12.  
  13. $jsonDecode =json_decode($output);
  14. echo "value is ".$jsonDecode -> field1."<br>";
  15.  
  16. curl_close($ch);
  17. echo "<br><br>";
  18. }
  19.  
  20. $stack = array("search=par1","search=par2","search=par3");
  21.  
  22. $filename = "test.txt";
  23. $source_file = fopen( $filename, "r" ) or die("Couldn't open $filename");
  24. while (!feof($source_file)) {
  25.  
  26. array_push($stack, "search=".fgets($source_file));
  27. }
  28. fclose($source_file);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement