Php Iterate Over Key Value Javascript For Loop