Php Unique Items In Array Javascript Iteration