Jump to content

[SOLVED] readin from STDIN


rosenrosen

Recommended Posts

I'd like to read something from STDIN using something like:

 

echo "Enter your name: \n";

$name = trim(fgets(STDIN));

 

First, how can I echo the characters to the screen at the same time so the person can see what they are typing?

Second is there a way to get it to work without the "\n" in the echo statement?  I'd like the text to appear on the same line as the prompt.

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/124994-solved-readin-from-stdin/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.