Iphone won't turn on, freeezes and restarts?

I turned it on and it took forever on the screen with the little apple logo, then it got on the lock screen and froze there for a bit and wouldn't let me do anything, and then the apple logo came back up and it restarted itself, i plugged it into the charger and it still continues to do the same thing. But it just sits on the black screen, then a little loading circle comes up, then that freezes, and then it completely just flashes white for a second, turns back off, and then goes back to the apple logo screen and then restarts this whole process^^

Are you sure that its charging and you didn't drop it anywhere?

Hold the home and power button for awhile til it restarts. If it does it again just restore it via itunes