View Single Post
Old 06-26-2006, 05:02 PM  
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by acctman
Hi i'm stuck on where to add my Do While Loop statement ... below is the section of the coding that is being processed. what is happening is the source is examined and the version codes are grabbed. but, it needs to loop through the source and grab all version codes and not just the first one.

thanks in advance

Code:
                $resp = curl_exec($ch); 
                //echo "$resp\n"; 
                curl_close($ch);       
                $startkey = "<024version>"; 
                $stopkey = "</024version>";         
                $startpos = strpos($resp, $startkey);  
                if ($startpos !hahahaha false) {  
                    $startpos += strlen($startkey);  
                    $endpos = strpos($resp, $stopkey, $startpos); 
                    $len = ($endpos - $startpos);  
                    $writecontent .= substr($resp, $startpos, $len)."\n";  
                    echo "$writecontent\n"; 
     
                } 
$fp = fopen($outputfile,"w"); 
fwrite($fp,$writecontent); 
fclose($fp);
If it's not all XML, use preg_match_all()
http://us3.php.net/preg_match_all
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote