To iterate through all the elements in $new_new_array, I use the foreach command like this:
foreach { $new_new_array as $x) {
print "$x------";
}
This is a loop that will happen 4 times if your array has elements [0], [1], [2], and [3]. Then inside the loop, you will have $x which represents the part you're working with at the moment. In other words, the first time through the loop, $x will be $new_new_array[0] and the 2nd time through the loop, $x will be $new_new_array[1] etc until the array is exhausted.
Then, inside the loop, you check to see if $x starts with the word "USERNAME:" like this:
foreach ( $new_new_array as $x) {
if (ereg("USERNAME:(.+)",$x,$regs)) { $username = $regs[1]; }
}
The .+ means "any characters that follow "USERNAME:" and the parentheses around .+ mean that the ereg command should store those characters in an array called $regs. Once the loop is finished, $username will have a value of whatever followed USERNAME: in any one of the elements of the array.