I have a script that has a bunch of different parameterized functions. Is it possible to call any of these functions from the command line and pass in the arguments instead of me having to hard code the function calls in the script?
F.Y.I: I do know how to execute a simple PHP script from the command line
doesn’t quite call the function, remember script.php has around 5 different functions and I am looking to call only 1, is that possible
No, you cannot do that directly. You have a few options:
Update:
Here is a example of using the first passed parameter as a function call: