I can't tell if my charging issue is my iphone or the charger?

So the cord has been messed up for a while, so I assume it's the cord. However in order to charge my iphone, I have to hold the charger like halfway in the phone. The left side barely in and the right side all the way in AND I have to hold the cord a certain way. While I'm fairly certain it's the cord, could it also be a phone problem too since it has to be half in/half our to charge?
I know it sounds stupid and obvious, but the fact it's has to be half in, half out is what confuses me.

It sounds like it actually might be the port. Try another charger and if you have the same problem you will know.