The city of Phoenix is getting a nearly $40 million grant from a housing and economic recovery law passed by Congress during the summer.