Php Reset Array After Foreach Js Syntax Validator