Php Loop Over Array Javascript Length Validation Master Plans