Hello, I found a function here in the stack for a problem similar to mine however I'm having a problem.
The function is:
function file_get_contents_retry($url, $attemptsRemaining=3) {
$content = file_get_contents($url);
$attemptsRemaining--;
if( empty($content) && $attemptsRemaining > 0 ) {
return file_get_contents_retry($url, $attemptsRemaining);
}
return $content;
}
My problem is that after getting the information I have a echo "sucesso";
that returns a $ .post function.
However, it seems to me that when the function of some error in some attempt, $ .post, besides catching the success of the echo it takes this error.
I need to know how to remove this error.
Any tips?