The Knicks are hoping the phrase “like father, like son’’ will bear fruit at the Garden.

The Knicks selected Tim Hardaway Jr. last night with the 24th pick in the first round of the NBA Draft. Hardaway’s selection was cheered at Brooklyn’s Barclays Center even though his father, Tim Hardaway, was always booed in New York as a hated member of the Heat.

“He’s obviously got some good bloodlines from someone who had a great NBA career,’’ Knicks general manager Glen Grunwald said.

The Michigan shooting guard had a great workout with the Knicks this month and helped lead the Wolverines to the NCAA championship game.

“We think we added a good piece to our team, talented, good worker, good athlete who comes from a great program,’’ Grunwald said.

The cheers for Hardaway were a rarity for a Knicks selection. Even the biggest cynic couldn’t dispute this safe, solid pick as the Knicks brace for the possibility of J.R. Smith, Pablo Prigioni and Chris Copeland fleeing as free agents.

“I thought about how his father used to kill the Knicks,’’ superfan Spike Lee said on ESPN when asked his initial reaction.

Hardaway Jr. shot lights out during his workout with the Knicks, is a good defender and scouts have called him a “pro’s pro.’’

His father, once the archrival of the Knicks and assistant GM Allan Houston, made the All-Star Team five times. Houston, who warred against Hardaway in the late 1990s playoff series between the clubs, sat next to Grunwald in the war room at the Knicks’ Westchester facility when the pick was made.

“I think the wound has healed a little bit for Allan,’’ Grunwald said. “I know Allan’s excited about this, too. Hopefully Allan can add something to his development because they are similar players.’’