I have a bash .sh file where I want to call a function located inside of a .php script file, and store the php response in a bash variable.
So far in my bash
#!/bin/bash
/usr/bin/php checkVer.php
Which will run checkVer.php but I want it to run only a particular function.
So I try
#!/bin/bash
PHP_OUT=`php -r 'echo phpinfo();'`
echo $PHP_OUT;
but how does bash know the function phpinfo() is from my .php file?