readline

(PHP 4, PHP 5, PHP 7)

readline锟斤拷取一锟斤拷

说锟斤拷

readline ([ string $prompt ] ) : string

锟斤拷锟矫伙拷锟剿讹拷取一锟斤拷.锟斤拷锟斤拷锟斤拷约锟绞癸拷锟� readline_add_history() 锟斤拷锟斤拷一锟斤拷锟斤拷拥锟斤拷锟绞凤拷锟铰硷拷锟�

锟斤拷锟斤拷

prompt

锟斤拷锟斤拷锟街革拷锟揭伙拷锟斤拷址锟斤拷锟斤拷锟斤拷锟轿拷没锟斤拷锟斤拷锟绞撅拷锟较�

锟斤拷锟斤拷值

锟斤拷锟矫伙拷锟剿凤拷锟斤拷一锟斤拷锟斤拷锟街凤拷锟斤拷.锟斤拷锟截的革拷锟叫碉拷锟斤拷尾锟斤拷锟叫凤拷锟结被删锟斤拷

锟斤拷锟斤拷

Example #1 readline() Example

<?php
//get 3 commands from user
for ($i=0$i 3$i++) {
        
$line readline("Command: ");
        
readline_add_history($line);
}

//dump history
print_r(readline_list_history());

//dump variables
print_r(readline_info());
?>