Java While Loop Through An Array Php Format