I have a file called address.php with a few functions in it. I want to call a specific function in that file from the command line. How?
The name of the function is called exportAddress and that function expects a single parameter.
By using the -r
parameter you can run a script in-line.
php -r "require 'address.php'; exportAddress(12345);"
There are no other options. A function in PHP can only be called by a PHP script.