Created
July 19, 2019 02:20
-
-
Save parzibyte/e56f1f2058480d40d0ec99c7af408b09 to your computer and use it in GitHub Desktop.
Acceder a argumentos de la línea de comandos con PHP https://parzibyte.me/blog
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 | |
echo "Hay $argc argumentos\n"; | |
foreach ($argv as $argumento) { | |
echo "Recibido un argumento: $argumento \n"; | |
} | |
/* | |
Salida: | |
Hay 3 argumentos | |
Recibido un argumento: argumentos.php | |
Recibido un argumento: Hola | |
Recibido un argumento: mundo | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment