This paper develops a dynamic programming (DP) based framework for simultaneously optimizing the charging and power management of a plug-in hybrid electric vehicle (PHEV). These two optimal control problems relate to activities of the PHEV on the electric grid (i.e., charging) and on the road (i.e., power management). The proposed framework solves these two problems simultaneously in order to avoid the loss of optimality resulting from solving them separately. The framework furnishes optimal trajectories of the PHEV states and control inputs over a 24-hour period. We demonstrate the framework for 24-hour scenarios with two driving trips and different power grid generation mixes. The results show that addressing the above optimization problems simultaneously can elucidate valuable insights for certain combinations of daily driving scenarios, grid generation mixes, and optimization objectives. For example, in one of the cases considered, the grid produces higher CO2 per unit energy between 3AM and 8AM. This causes the optimal PHEV state and control input trajectory to refrain from completely charging the PHEV's battery in the early morning, and judiciously combine electricity and gasoline while driving. The paper's main contribution to the literature is a framework that makes it possible to evaluate tradeoffs such as this one.