Typescript See If Array Php Use For Loop