Update parser.php

Fixed array iteration to work properly