I have this function:
exec("sudo /root/modbus/writeForceReg 2 0");
located in a php script. When I execute the script in terminal, it returns either 1 or -1 in the terminal window. My question is how to capture and store these two values in a variable in the same php script?