I am using a file_get_contents along with a new SimplexmlElement($xml) in which sometimes the XML I'm pulling has a Error sign like below. I would like to loop the request until the error message is no more and store the XML. I have the parse already setup. But don't know how to do the loop of file_get_contents with the SimplexmlElements. The error I get is < error > < h2 > ERROR < / error >
Is there a way to loop a get_file_contents until condition is met in XML then us the current XML of the one where there isn't an error?