justinh Posted February 3, 2009 Share Posted February 3, 2009 <?php while ( $objComport->LastError == 0 ) { $result = preg_match_all('/ *([1-9]+[a-z]) */', $objComport->ReadString(), $all_matches); $ct = count($all_matches); for($i = 0; $i <= $ct; ++$i){ echo $i . $all_matches[$i] ."<br>"; } } ?> Since this is in a while loop, I'm guessing I need to do something different with the $all_matches array. How would you add the current information to the array? Link to comment https://forums.phpfreaks.com/topic/143591-while-loop/ Share on other sites More sharing options...
gevans Posted February 3, 2009 Share Posted February 3, 2009 what are you currently getting on screen? Link to comment https://forums.phpfreaks.com/topic/143591-while-loop/#findComment-753419 Share on other sites More sharing options...
justinh Posted February 3, 2009 Author Share Posted February 3, 2009 0Array 1Array 2 0Array 1Array 2 0Array 1Array 2 0Array 1Array 2 0Array 1Array 2 0Array 1Array 2 Link to comment https://forums.phpfreaks.com/topic/143591-while-loop/#findComment-753420 Share on other sites More sharing options...
gevans Posted February 3, 2009 Share Posted February 3, 2009 instead of echo do this var_dump($all_matches); exit; Then we can see what the whole array holds Link to comment https://forums.phpfreaks.com/topic/143591-while-loop/#findComment-753425 Share on other sites More sharing options...
justinh Posted February 3, 2009 Author Share Posted February 3, 2009 array(2) { [0]=> array(0) { } [1]=> array(0) { } } Link to comment https://forums.phpfreaks.com/topic/143591-while-loop/#findComment-753426 Share on other sites More sharing options...
gevans Posted February 3, 2009 Share Posted February 3, 2009 it looks like the problems with your preg_match Link to comment https://forums.phpfreaks.com/topic/143591-while-loop/#findComment-753428 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.