Locking an iPhone if button is broken? My friend's iPhone's sleep/wake button no longer works. Is there any way to turn off the screen besides setting up auto-lock and waiting a few minutes?
It appears that if you go into Settings > General > Accessibility and enable Assistive Touch, a new transparent button appears on your iPhone. This button can be accessed all the time. It is overlayed over anything appearing on your phone. If you tap it, and then tap Device, one of the options is Lock Screen.

Instead of having the icon always be visible, you can go to the Triple-click Home setting under the Accessibility page and choose AssistiveTouch. This way you can easily show or hide the button with a triple-click of the home button!