Why does the silent on/off switch on my iPhone say there are headphones in when there's not?

Why does the silent on/off switch on my iPhone say there are headphones in when there's not?

Restart your iPhone and check again.

Could have something in the port that is making it report that incorrectly. Try cleaning it out.