Typescript Array Map Function In Php