Answer the question
In order to leave comments, you need to log in
What is the correct way to work with the getopt function?
You need to write a CLI script in php. There is a task to transfer data to the script through the console.
I paid attention to this function:
php.net/manual/ru/function.getopt.php
However, I did not quite understand how to work with it correctly. There are several questions at once:
1) Why support 2 arguments options and longopts. On the docs: The options and longopts formats are practically the same. ...
2) What is the difference between mandatory and optional attributes, if you take an example from the docks and do not pass mandatory attributes, there will be no errors, why?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question