LOS ANGELES — Knicks starting shooting guard Arron Afflalo bought a bunch of tickets for friends and family for Friday’s game against the Clippers, so missing the contest with an abdominal strain wasn’t easy.

But on this long Hollywood weekend, Afflalo, who grew up in L.A. and attended UCLA, returned to action Sunday when the Knicks topped the Lakers, 90-87, in Kobe Bryant’s final game against the Knicks. Because of limitations, Afflalo, who purchased 20 more tickets for Sunday’s game at Staples Center, came off the bench.

Afflalo, who finished with nine points and two assists in 27 minutes, has a lot more on his mind than his new stomach injury. His first season with the Knicks started off badly, missing most of training camp with a hamstring strain and the season’s first seven games. He got rolling through mid-November to mid-January, then sort of crashed and burned after making a playoff guarantee. He was still averaging a respectable 13.9 points on 46 percent shooting but his defense hasn’t been as good as advertised.

He signed a two-year, $16 million contract, but has an opt-out after this season. Part of the reason Phil Jackson decided to join the Knicks on this road trip and eschew scouting the college tournaments — his team doesn’t have a first-round pick — was to witness the Knicks’ potential free agents.

“I really don’t know what I’m going to do,’’ Afflalo told The Post. “We’ll definitely have to address that when that times comes. Of course. I had a great first-year experience here. Obviously some ups and downs. One of those things I have to have a discussion with management and see how things go.”

Jackson alluded to Afflalo as a player who may have fallen victim to fatigue because of the heavy workload, indicating he may see him more as a backup next season as he looks to upgrade the modest backcourt. The salary cap is rising drastically but it’s unclear where Afflalo’s market value is. However, his hometown Lakers have $60 million of cap space.

Afflalo, who will be 31 next season, has an easy relationship with Carmelo Anthony, dating to their time together in Denver. Afflalo pushed to have the clause in his pact but acknowledged the uncertainty.

“I’ve been through it a few times,’’ Afflalo said. “I try to look at my personal situation that would fit and try to get the best money value, but it’s one of those things, you never know. So many things shake up and change at a moment’s notice. Unless you’re a max guy and teams will wait on you, it’s hard to get answers until that moment comes.’’

Rookie Kristaps Porzingis missed his third game of the season Sunday with a stomach illness.

Interim coach Kurt Rambis said Porzingis was vomiting before the game.

Bryant said on Friday Jackson’s influence on him has been everlasting.

“His philosophy of the game and philosophy on life is something I’ve adopted,’’ Bryant said of his former coach. “I carry it with me.”

Lakers coach Byron Scott said Carmelo Anthony — who scored 26 points and grabbed 12 rebounds — is not being as explosive or squarely in his prime.

“I’ve always thought of Melo as one of the most gifted offensive players I’ve seen in a long time, especially when he was in his prime,’’ Scott said. “LeBron was great, Kobe was unbelievable but just a natural all-around scorer, Carmelo was one of the best I’ve seen. I still think even at his age, he can still get it done on certain days. He just doesn’t do it with the explosiveness he used to do it with.’’