Hosni Mubarak, the ousted former president of Egypt, has been sentenced to three years in prison on charges of stealing from public funds.