Results of 1 - 2 of about 2 for shortopts (0.001 sec.)
- コマンドライン引数のリストからオプションを取得する 11228
- « getmyuid getrusage » PHP Manual PHP オプション/情報 関数 コマンドライン引数のリストからオプションを取得する 検索 getopt (PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8) getopt — コマンドライン引数のリストからオプションを取得する 説明 function getopt
... ray(2) { ["f"]=> string(5) "value" ["h"]=> bool(false) } 例2 getopt() の例:長いオプション <?php // スクリプト example.php $shortopts = "" ; $shortopts .= "f:" ; // 値が必須 $shortopts .= "v::" ; // 値がオプション $shortopts .= "abc" ; // これらのオプション ... "required:" , // 値が必須 "optional::" , // 値がオプション "option" , // 値なし "opt" , // 値なし ); $options = getopt ( $shortopts , $longopts ); var_dump ( $options ); ?> shell> php example.php -f "value for f" -v -a --required value --optional="option ... 連キーワード: options php getopt false array パラメータ rest index example bool value string スクリプト short long 要素 必須 shortopts optional 配列 ...
-
https://man.mtool.work/php/8.3/function.getopt.html
- コマンドライン引数のリストからオプションを取得する 7485
- « getmyuid getrusage » PHP Manual PHP オプション/情報 関数 コマンドライン引数のリストからオプションを取得する 検索 getopt (PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8) getopt — コマンドライン引数のリストからオプションを取得する 説明 function getopt
... ray(2) { ["f"]=> string(5) "value" ["h"]=> bool(false) } 例2 getopt() の例:長いオプション <?php // スクリプト example.php $shortopts = "" ; $shortopts .= "f:" ; // 値が必須 $shortopts .= "v::" ; // 値がオプション $shortopts .= "abc" ; // これらのオプション ... "required:" , // 値が必須 "optional::" , // 値がオプション "option" , // 値なし "opt" , // 値なし ); $options = getopt ( $shortopts , $longopts ); var_dump ( $options ); ?> shell> php example.php -f "value for f" -v -a --required value --optional="option ... rray(1) { [0]=> string(4) "test" } 参考 $argv 関連キーワード: options getopt rest index example スクリプト short long 必須 shortopts optional コロン dump shell コマンドライン パース 認識 longopts required option ハイフン マッチ 時点 空白 args ...
-
https://man.mtool.work/php/8.3/function.getopt.html
PREV
1
NEXT