While Loop Array Php Functions Definitions