Philippians 4:11 ends saying "I have learned in whatever state I am to be content." He then goes on to list areas of drastic contrast of each other that he has been. Then in verse 13 he states "I can do all things through Christ who strengthens me."
It probably was hard for Paul at first to find contentment. He came from the finer side of town and then found himself imprisoned for saying what he believed. Not in one of the cushy prisons we have, but knee high in sewer and rodents. That had to be a test of faith. As we read it, we get the end result, "I did it. Be encouraged."
That is the key to contentment. Knowing that regardless of what you may be physically, emotionally, mentally, socially, economically, spiritually and environmentally facing - in God's strength you will get through it with Jesus Christ.