PHP Code to open / close the door

I need to develop a php script to command the opening or closing of the door. The communication between the script and the port is local on the same LAN.
What is the best call to use with curl?

look here

I need also to build php code to open smartlock from webrowser, can you share. php code?