Any way you could open it up and fix it? A laptop I had was having an issue with the button and I just opened it and managed to fix the mechanism controlling it. I don't know if phones are so amenable to tinkering though...
I'd have to either replace the motherboard, or replace the power button on the motherboard. Both technically possible, but expensive/time consuming enough that buying a new phone makes more sense to me.
I do actually have my old one working now, I took out the external power button and manipulate the switch with a paperclip. Not a long term solution... What kind of phone is it?
Unfortunately I'm a bit of a sheep who upgrades every two years. Would probably save money just buying a durable phone and keeping it.
nexus 5