Php Loop Over Key Value Array Javascript Append Function In String