readline

Reads a line

Syntax

readline(?string $prompt = null): string|false

Parameters

prompt

You may specify a string with which to prompt the user.

Return

Returns a single string from the user. The line returned has the ending newline removed. If there is no more data to read, then false is returned.

Examples

1 · void

<?

$return = readline();

var_export($return);

?>
false

2 · prompt

<?

$prompt = "myprompt";

$return = readline($prompt);

var_export($return);

?>
false

readline_add_history

readline_callback_handler_install

readline_callback_handler_remove

readline_callback_read_char

readline_clear_history

readline_completion_function

readline_info

readline_list_history

readline_on_new_line

readline_read_history

readline_redisplay

readline_write_history

PHP

Home Menu