I'm trying to send a get request using PHP and curl to retrieve a JSON array using rest API request works fine when I test it by entering the address in chrome address bar or even in command prompt or PowerShell , but it returns an empty array using PHP curl , here is my code
<?php
$baseUrl="https://amitex.biz/delegateapi/createhotvoucher";
$myUrl=$baseUrl.'?'.http_build_query(array(
'SecurityCod'=>'19648A15',
'password'=>'xyziuqjq&',
'HotVoucherAmount'=>'1'
));
echo $myUrl;
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_URL,$myUrl);
$content = curl_exec($ch);
echo $content . "<br>";
print_r($_GET);
when i enter the address in browser it returns somting like this >
I have tried below solutions like how to act like a browser to send get request and how to retrieve JSON using curl , but still not working