Php Set Empty Array Javascript Iteration