PHP waiting for correct response with cURL
问题 I don't know how to make this. There is an XML Api server and I'm getting contents with cURL; it works fine. Now I have to call the creditCardPreprocessors state. It has 'in progress state' too and PHP should wait until the progess is finished. I tried already with sleep and other ways, but I can't make it. This is a simplified example variation of what I tried: function process_state($xml){ if($result = request($xml)){ // It'll return NULL on bad state for example return $result; } sleep(3);