Php For Each Item In Array Javascript Iteration