Following an earlier post I am trying to pull 7 digit numbers from a string containing other random characters and place into an array ($array).
This part's working OK but I am trying to use a do while loop to output all the results. All the matches print to the screen OK but it then gets stuck in a endless loop.
Here's my script
$string = "0065678 abcfrd 0098765 hjkiuk 0076567 asfgh 0076542";
$result = preg_match_all("/00[0-9]{5}/",$string, $array);
$i=0;
do{
echo $array[0][$i]."<br>";
$i++;
}while($result);
Any ideas how to do this and terminate the loop?
Thanks