Created
July 18, 2018 12:48
-
-
Save bdelespierre/445166ab6e2ada42905f6ccba4819927 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ---------------------------------------------------------------------------- | |
// $argc: nombre d'argument de la commande | |
// ---------------------------------------------------------------------------- | |
// e.g. pour la commande 'php file.php foo bar baz', | |
// $argc vaut 3 | |
// car il y a 3 arguments: "foo", "bar", et "baz" | |
var_dump($argc); | |
// ---------------------------------------------------------------------------- | |
// $argv: tableau des arguments de la commande (l'élément zéro est le nom du | |
// fichier) | |
// ---------------------------------------------------------------------------- | |
// e.g. pour la commande 'php file.php foo bar baz', | |
// $argv vaut ['file.php', 'foo', 'bar', 'baz'] | |
// car il y a 3 arguments: "foo", "bar", et "baz" | |
var_dump($argv); | |
// ---------------------------------------------------------------------------- | |
// readline('message: '): attend une saisie sur la console et renvoie | |
// le résultat | |
// ---------------------------------------------------------------------------- | |
$string = readline('message: '); | |
var_dump($string); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment