note 114000 added to features.commandline.usage
| From: | pier | Date: | Sat, 28 Dec 2013 11:06:33 +0000 |
| Subject: | note 114000 added to features.commandline.usage | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198041@lists.php.net to get a copy of this message | ||
Just a note about arguments (php cli on debian 7 )
using a simple script
---
#!/usr/bin/php
<?php
echo $argc . "\n"
?>
---
you get
---
root@crowdsourcingFTW:# ./passed_arguments.cli.php a b c d
5
root@crowdsourcingFTW:# ./passed_arguments.cli.php a b c d "e f"
6
root@crowdsourcingFTW:# ./passed_arguments.cli.php a b c d 'e f'
6
root@crowdsourcingFTW:# ./passed_arguments.cli.php a b c d {e f}
7
root@crowdsourcingFTW:# ./passed_arguments.cli.php a b c d "e f"
6
So using "text with spaces" or 'text with spaces' is recognized as one argument.
I would like to know which are all the construct to pass multiple arguments as one argument.
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/features.commandline.usage.php
Edit -- https://master.php.net/note/edit/114000
Del: integrated -- https://master.php.net/note/delete/114000/integrated
Del: useless -- https://master.php.net/note/delete/114000/useless
Del: bad code -- https://master.php.net/note/delete/114000/bad+code
Del: spam -- https://master.php.net/note/delete/114000/spam
Del: non-english -- https://master.php.net/note/delete/114000/non-english
Del: in docs -- https://master.php.net/note/delete/114000/in+docs
Del: other reasons-- https://master.php.net/note/delete/114000
Reject -- https://master.php.net/note/reject/114000
Search -- https://master.php.net/manage/user-notes.php