PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<readline_write_historyRecode>
Last updated: Mon, 16 Jul 2012

readline

(PHP 4, PHP 5)

readline -- Reads a line

Description

string readline ( string prompt )

This function returns a single string from the user. You may specify a string with which to prompt the user. The line returned has the ending newline removed. You must add this line to the history yourself using readline_add_history().

例子 1. readline()

<?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());
?>



<readline_write_historyRecode>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST