On Wed, 5 Mar 2003 12:06:41 -0500, 1LT John W. Holmes wrote: >> The full code in the loop is. >> Later on in the code after the loop I do >> >> echo "printing array matches <br>"; >> print_r ($matches);echo "<br>"; > >$matches is going to be over-written after every time through the loop! It >doesn't add it all up. > >Add in a > >$var[] = $matches; > >or something inside of your loop to keep track of them all, then >print_r($var) to see what it contains.
Thanks that fixed it I ended up with. with the $ts string | and | the | $hit[] = preg_match ($ts, $line_in,$var); $matches[] = $var; but it still it needed $var = array(); before it would work. The results are interesting and shows I don't understand arrays :( print_r ($matches); printing array matches (reformatted) Array ( [0] => Array ( ) [1] => Array ( ) [2] => Array ( ) [3] => Array ( ) [4] => Array ( ) [5] => Array ( ) [6] => Array ( [0] => and [1] => and ) [7] => Array ( [0] => the [1] => the ) [8] => Array ( [0] => and [1] => and ) [9] => Array ( ) [10] => Array ( ) [11] => Array ( ) [12] => Array ( [0] => and [1] => and ) [13] => Array ( ) [14] => Array ( ) [15] => Array ( ) [16] => Array ( [0] => the [1] => the ) [17] => Array ( ) [18] => Array ( [0] => and [1] => and ) [19] => Array ( ) [20] => Array ( ) So how do you interpret that a sort of instant 2D array. {R} -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php