Iphone 4 thinks headphones are NOT plugged in?

It's getting annoying because I can't listen to music with my headphones anymore (and the headphones work, because i use them with my laptop and haven't had any issues before)

Clean out your headphone jack on the iphone. Use dustoff or blow into it. Then plug your headphones in, try twisting them around while playing a song and see if you can hear ay crackling or if the iphone recognizes the headphones are being put in or not,(irpt will pause the song and the volume will probably change) if that doesn't work then i hope you have a warranty.