The Ducks became the first team in the NHL to reach 40 victories this season and expanded their lead over San Jose at the top of the Pacific Division to 11 points.
Philadelphia lost for the fifth time in six outings in what was the opener of a three-game California trip.
Patrick Maroon opened the scoring for the Ducks midway through the first period and Vincent Lecavalier tied it on the power play four minutes later.
With time running down in the opening stanza, Getzlaf got his stick on a shot from Hampus Lindholm and re-directed it past Steve Mason.
Corey Perry added an Anaheim goal in the second period, Daniel Winnick scored shorthanded with 7:24 to go in the third after the Flyers had closed within one and Saku Koivu added an empty-net goal with 24 seconds remaining.
Fredrik Anderson made 26 saves to claim the win, giving up a goal to Michael Raffl 10 seconds after Koivu had scored. Mason allowed four goals on 28 shots.
Pistorius testifies he didn't consciously pull trigger when he shot girlfriend
Biologists detail four new deep-sea 'killer sponges'