← All built-ins / readline()

readline()

readline(string $s): string

Parameters

NameTypeDescription
$promptstringtext shown before reading

Return value

One line from stdin (for interactive scripts).

Example

echo "readline reads one stdin line";
readline reads one stdin line

This call needs a real environment (window, server, database or stdin) — the snippet above shows the typical usage shape.

See also

getenv()