How to turn off iPhone with broken lock and screen doesn't work?

My phone's lock button broke a while ago and have been using it without a functioning lock button for a while now. Whenever I woke up, I see everything on the screen and I can get to the slide to power off screen, but I can't slide to power off. I can't slide to unlock so I thought I would try to restart it and turn it off for a while. Is it possible to turn it of with a computer or does anyone know a fix?

I know this might stink but i have 2 ways:
1. Take it apart and possibly harm it to get battery out.
2. Go to apple store and have them repair it
Or just let it die…

Easy, put auto lock on 1 minute, so it will lock itself pretty quickly- Settings-General-Auto Lock. Equally get it repaired. Though it may be expensive. Consider getting a new phone also.

Turn on Assitive Touch. Settings>General>Accesibility>A… Then click it and it will say lock screen.

1.setting 2. Accessibility 3. Assistivetouch