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.
Result of php executing
Full code of voucher.php
- <?php
- $curl = curl_init();
- curl_setopt_array($curl, array(
- 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',
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => '',
- CURLOPT_MAXREDIRS => 10,
- CURLOPT_TIMEOUT => 0,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_CUSTOMREQUEST => 'GET',
- ));
- $response = curl_exec($curl);
- curl_close($curl);
- echo $response;