mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-06 14:06:34 +02:00
Changed CLI name variable signature from optional to argument
This commit is contained in:
committed by
GitHub
parent
e8c464dcea
commit
b4d2228b8e
@@ -27,7 +27,7 @@ Let's write a simple "Hello, $name" CLI program. To try it out, create a file na
|
||||
{% highlight php %}
|
||||
<?php
|
||||
if ($argc !== 2) {
|
||||
echo "Usage: php hello.php [name].\n";
|
||||
echo "Usage: php hello.php <name>.\n";
|
||||
exit(1);
|
||||
}
|
||||
$name = $argv[1];
|
||||
@@ -45,7 +45,7 @@ To run our script, above, from the command line:
|
||||
|
||||
{% highlight console %}
|
||||
> php hello.php
|
||||
Usage: php hello.php [name]
|
||||
Usage: php hello.php <name>
|
||||
> php hello.php world
|
||||
Hello, world
|
||||
{% endhighlight %}
|
||||
|
Reference in New Issue
Block a user