Php Loop Over Array Javascript Documentation