Php Empty An Array Javascript Iteration