PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.comp.lang.php > Re: command line and get user input
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Re: command line and get user input

Réponse
 
LinkBack Outils de la discussion
Vieux 24/07/2007, 15h00   #1 (permalink)
ZeldorBlat
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: command line and get user input

On Jul 24, 9:50 am, "Jean Pierre Daviau" <O...@WasEno.ugh> wrote:
> Hi everybody,
>
> On command line is there a simple way to get user input? I am
> not thinking of argc.
> I red about the complicated to install Readline (GNU).
>
> I have found this in the manual wich does not work
> -------------------------------------- Maybe this snippets
> needs some tuning ----------------------------------
>
> // read tree entriesfor ($i=0; $i < 3; $i++) {
> $line = readline("Commande : ");
> readline_add_history($line);
>
> }
>
> // List
> print_r(readline_list_history());
>
> // Liste les variables
> print_r(readline_info());
> --------------------------------------
>
> Thanks for your attention.
>
> Jean Pierre Daviau
> --
> windows Xp
> asus p4 s533/333/133
> Intel(R) Celeron (R) CPU 2.00 GHz
> Processor Radeon7000 0x5159 agp


Readline is what you want. And, no, it isn't complicated at all:

$userInput = readline('Enter something here: ');

That's it.

  Réponse avec citation
Vieux 24/07/2007, 16h41   #2 (permalink)
Jean Pierre Daviau
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: command line and get user input

C:\Documents and Settings\Jean Pierre\Bureau>php -a
Interactive mode enabled

<?
$userInput = readline('Enter something here: ');

Fatal error: Call to undefined function readline() in
C:\Documents and Settings\
Jean Pierre\Bureau\- on line 2




"ZeldorBlat" <zeldorblat@gmail.com> a écrit dans le message de
news: 1185285651.829943.169160@w3g2000hsg.googlegroups.c om...
> On Jul 24, 9:50 am, "Jean Pierre Daviau" <O...@WasEno.ugh>
> wrote:
>> Hi everybody,
>>
>> On command line is there a simple way to get user input? I am
>> not thinking of argc.
>> I red about the complicated to install Readline (GNU).
>>
>> I have found this in the manual wich does not work
>> -------------------------------------- Maybe this snippets
>> needs some tuning ----------------------------------
>>
>> // read tree entriesfor ($i=0; $i < 3; $i++) {
>> $line = readline("Commande : ");
>> readline_add_history($line);
>>
>> }
>>
>> // List
>> print_r(readline_list_history());
>>
>> // Liste les variables
>> print_r(readline_info());
>> --------------------------------------
>>
>> Thanks for your attention.
>>
>> Jean Pierre Daviau
>> --
>> windows Xp
>> asus p4 s533/333/133
>> Intel(R) Celeron (R) CPU 2.00 GHz
>> Processor Radeon7000 0x5159 agp

>
> Readline is what you want. And, no, it isn't complicated at
> all:
>
> $userInput = readline('Enter something here: ');
>
> That's it.
>



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h23.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08337 seconds with 10 queries