Skip to main content

How to use Infatica Residential proxy with PHP

Once you have created a proxy list at Infatica, you can use a proxy with PHP.

PHP example:

# In this example a query to ip-api.com is performed from the Infatica proxy.

# Change the proxy login, password, IP, and port from your proxy list if you use authorization by login/password.
$proxy = 'http://login:password@Host:Port';
$query = curl_init('https://ip-api.com');
curl_setopt($query, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($query, CURLOPT_PROXY, "$proxy");
$output = curl_exec($query);
curl_close($query);
if($output) {
echo $output;
}