Cullen Posted January 11, 2011 Share Posted January 11, 2011 how can you increase the page number in the following line until $status returns an empty result? curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml", "Authorization: xxxxxxxxxxxxx:xxxxxxxxxxxxxxxx", "Page: 2")); Link to comment https://forums.phpfreaks.com/topic/224109-increasing-a-number-inside-a-variable/ Share on other sites More sharing options...
Psycho Posted January 11, 2011 Share Posted January 11, 2011 I don't see where $status is being updated. If $status is never updated the loop would run indefinitely. I would probably add some sort of counter to halt execution at some outer boundry; $page = 1; while($status != null) { curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml", "Authorization: xxxxxxxxxxxxx:xxxxxxxxxxxxxxxx", "Page: {$page}")); $page++; //Stop at 1000 pages to prevent infinite loop if($page>1000) { break; } } Link to comment https://forums.phpfreaks.com/topic/224109-increasing-a-number-inside-a-variable/#findComment-1158006 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.