PHP getopt Operations

后端 未结 3 1779
梦如初夏
梦如初夏 2021-01-11 19:19

This question is regarding getopt function in php. I need to pass two parameter to the php scripts like

php script.php -f filename -t filetype
3条回答
  •  遥遥无期
    2021-01-11 19:44

    There is a problem in your approach. What if user gives following command line by mistake. the script will not be able to detect it and fail as $file['t'] will be an array.

    php temp.php -f filename -t filetype -f filename2
    

提交回复
热议问题