The code below is an example only.  This was tested with PHP 7.3.  


<?php

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.ipify.org/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_PROXY, 'ca-1.us.proxies.com:35051');
curl_setopt($ch, CURLOPT_PROXYPORT, 35051);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, 'someUsername:somePassword');

curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME);

curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);

$result = curl_exec($ch);
$info = curl_getinfo($ch);
$error = curl_error($ch);

echo $result;

curl_close($ch);