How to shut down iPhone without lock button?

Completely shut down to apple logo if the power button is broken

The only way I can think of is plug it into the computer, and restore, and then put it back to normal. This resets the iPhone, which I assume you're trying to do, as no one actually switches it off nowadays.
You could also try to do a system update. This also reboots it.

Go to Settings on your iphone.go down to General, then Accessibility, then go down to Assistive Touch. Tap the Assistive Touch ON. Exit Settings and at the bottom right of your screen you will find a round button. Press it to enter Assistive Touch. Press the Device Button on the right. Now PRESS AND HOLD the Lock Screen Symbol until the Power Down Slider appears at the top of the screen. Slide to the right to power off.