If you have Warranty or AppleCare make Genius reservation or set up Service and take or send to Apple for resolution. If no coverage, the internal switch can be fixed with a minute drop of glue, or if completely broken, replacement of the Power Button Flex cable. If you want to try Virtual Lock Button, tap Settings App > General > Accessibility > Assistive Touch > ON > tap new small white screen button > Device > Lock. This can even be used to turn iPhone OFF. To turn ON connect iPhone to power ie charger or USB port of computer.
This site contains user submitted content, comments and opinions and is for informational purposes only.
Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site.