voucher - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of voucher.php

  1. <?php
  2.  
  3. $curl = curl_init();
  4.  
  5. curl_setopt_array($curl, array(
  6.   CURLOPT_URL => 'https://api.ucc.edu.gh/api/v1.0/?req_type=4&public_key=Mm5bCzrTcj1GKZFHwO6IuY9LA8pXqDW0&private_key=UCCAPI202012310354&prefix=gcb&mode=Pg&bank_transid=3234334555&trans_date=12-02-2020',
  7.   CURLOPT_RETURNTRANSFER => true,
  8.   CURLOPT_ENCODING => '',
  9.   CURLOPT_MAXREDIRS => 10,
  10.   CURLOPT_TIMEOUT => 0,
  11.   CURLOPT_FOLLOWLOCATION => true,
  12.   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  13.   CURLOPT_CUSTOMREQUEST => 'GET',
  14.  
  15. ));
  16.  
  17. $response = curl_exec($curl);
  18.  
  19. curl_close($curl);
  20. echo $response;
File Description
  • voucher
  • PHP Code
  • 29 Mar-2021
  • 564 Bytes
You can Share it: