How to put the proxies in php_curl

Q: How can I use the proxies with PHP’s curl? A: <?php $ch = curl_init(‘https://bing.com’); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_PROXY, ‘proxyIP:proxyPass’); curl_setopt($ch, CURLOPT_PROXYUSERPWD, ‘proxyUser:proxyPass’); //if you have socks proxies curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); //if you have http proxies curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); echo ‘exec=’ . curl_exec($ch); ?>

Read More