My iPhone malfunctioned yesterday. It seemed like the little socket, where you stick the charging cord, wasn't working.
I tried another cable. I tried another power supply.
I blew in the little socket.
But I apparently I didn't blow hard enough. Because at the Apple Store today they blasted some canned air into the hole, and it all started working again.
If you carry your phone in your pocket,
beware of lint in your socket!