Home >Backend Development >Golang >What is the equivalent of reading from php standard input?
I am transplanting a php script to listen to events of linux supervisor
.
This may be a stupid question but I can't understand what this amounts to
$fin = fopen ("php://stdin","r");
I need this because when the supervisor
fires an event, my script is also launched, and my script listens for events read from php://stdin
Read-only mode ("r"
) on fopen is PHP ignores the php:// handler .
Depending on what you want to do, you can use io.ReadAll(os.Stdin)
or bufio.NewScanner(os.Stdin)
(if you plan to read line by line ).
The above is the detailed content of What is the equivalent of reading from php standard input?. For more information, please follow other related articles on the PHP Chinese website!