Knicks president Phil Jackson wasn’t that much a basketball genius that if Duke center Jahlil Okafor and Kristaps Porzingis were both on the draft board last June, he would’ve gone Latvian.

According to an NBA source, as much as Jackson’s top adviser, Clarence Gaines Jr., wanted Jackson to take Porzingis even if the Knicks had the No. 1 pick, that wasn’t the way the Zen Master would have gone if it was a choice between the two big men.

Okafor was Jackson’s man.

“He had to draft Okafor — too much a sure thing,’’ the source said.

Jackson was slightly worried about Okafor’s height — he measured in at 6-foot-9 without shoes — but he never thought it possible Okafor would fall to No. 4.

As it happened, Okafor came close when the Lakers stunned the draft world by taking point guard D’Angelo Russell at No. 2. Instant rumblings surfaced that the Sixers, desperate for a point guard, would roll with Emmanuel Mudiay, leaving Jackson to choose between Okafor and Porzingis.

But the Sixers took Okafor, who is listed at 6-11 and will make his first NBA visit to the Garden on Wednesday amid a recent series of disturbing off-court transgressions.

You can make the argument that Porzingis is having the better rookie season and stands to be a more complete player than Okafor, who turns 20 on Dec. 15.

“He’s been pretty much as advertised, no surprises,’’ one NBA scout told The Post. “The surprise is off the court.’’

Okafor is averaging more points than Porzingis (17.5 to 13.4) and his shooting percentage is higher (46.2 to 42.5), but the 7-foot-3 Latvian has been the better rebounder — especially on the offensive glass — shot-blocker and free-throw shooter. He also shoots with more range. Porzingis is also posting victories, while Okafor hasn’t won an NBA game as part of the 0-18 Sixers.

“Offensively, he’s doing more than people think,’’ the NBA scout said of Okafor. “He’s not just a low-post guy. He has a face-up game, but not a lot of range. He’s a good passer, but that hasn’t come out because he’s surrounded by guys who aren’t shooters. But one thing that got Philly excited was his ability to make plays and he’ll showcase that when he gets more talent. His defense isn’t as bad as people think — he’s not a non-defender. His rebounding is OK but not a dominant rebounder.’’

That is where the entire NBA underestimated Porzingis, who is averaging 9.2 boards and 1.9 blocks. He has had eight double-doubles in 18 games.

“Absolutely the most surprising thing is [Porzingis’] rebounding,’’ the scout said. “He didn’t really rebound in the summer, wasn’t a rebounder in Europe. Had he done that coming in, if he was a major rebounder in Europe, he would’ve gone higher. It’s shocking to me because his body was a clear concern, but you read he gained 11 pounds. It was hard to predict.’’

As was Okafor’s brush with the law, perhaps due to frustration at being on a winless team after winning the NCAA Tournament. On draft night, the Chicago native looked crushed after the Lakers passed on him.

For his part, Porzingis declined to work out for the Sixers, but a source close to him says he was not opposed to being selected by them. Though Porzingis’ first choice was the Knicks, the Latvian saw in Philadelphia a low-pressure situation in which to grow where he would be a good fit with Nerlens Noel, the Sixers’ second-year big man.

Meanwhile, Okafor is feeling the pressure. He was involved in a fight outside a Boston nightclub last week which the Sixers and NBA security are investigating, with disciplinary measures possible. A subsequent report in the Philadelphia Inquirer stated that a gun was pulled on Okafor at a Philly nightclub in October. Three weeks ago, he reportedly was pulled over on the Ben Franklin Bridge going 108 mph.

“I’m sure Philly is stunned,’’ one league executive said. “Everyone knows how much background checks they did on him.’’

Okafor offered an apology on Twitter, saying, “I hold myself to a higher standard than anyone else ever could and I’m not proud of some of my decisions over the last few months. I own my choices both personally and now publicly. At this point I am cooperating and respecting the process I have to go through. Going forward I don’t want to be a distraction for my team and am grateful for the support and guidance those close to me are giving. I am 100% focused on my responsibility to the League, my teammates and fans.”

Even after Porzingis impressed at the Las Vegas summer league in which he blocked Okafor’s shot three times in a game, he got virtually no attention in the GM poll released before the regular season. Porzingis didn’t receive a single vote for Rookie of the Year, with Okafor earning 44.8 percent of the votes and four other rookies — Karl-Anthony Towns, Mudiay, Russell and Myles Turner — also receiving consideration.

Even in the category of who will be the best player of the rookie class in five years, Towns, Mudiay, Okafor and Russell each earned at least 10.3 percent of the voting. Porzingis received one vote.

The Sixers host the 2-14 Lakers Tuesday, so conceivably the Knicks, on a four-game slide, won’t face a winless team Wednesday. That probably would be best. Regardless, the Sixers have had close calls, including losing a double-digit fourth-quarter lead to Miami.

“They’re professionals in this league for a reason,’’ Arron Afflalo said. “We’re going through our own losing streak. We don’t intend to have any letdown.’’