Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created July 19, 2019 02:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/e56f1f2058480d40d0ec99c7af408b09 to your computer and use it in GitHub Desktop.
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
<?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