I have the following function:
function pegarWS($numero){
$PEGAR_WS = 'http://ws.com.br';
$URL = $PEGAR_WS.$numero;
$proxies = file('pasta/secreta/inacessivel/via/http/proxies.txt');
//Limpa espaços em branco
$proxies = array_map(function ($proxy) {
return trim($proxy);
}, $proxies);
// pegar random proxy
$proxy_to_use = $proxies[ rand( 0, count( $proxies ) -1 ];
foo
This particular part: (need to adapt)
$proxy_to_use = $proxies[ rand( 0, count( $proxies ) -1 ];
Instead of fetching the proxy randomly (see code), I need to change it so it reads line by line from txt (one at a time) in loop. That is, read the first line, then the second, and so on .. When you get to the last line it goes back to the first line.