The standard "php" binary cannot do this but if you don't already have it install "php-cgi"
apt install php-cgi
php-cgi yourscript.php "somevar=something&anothervar=anotherthing"
Just use the php-cgi binary, pass it your .php and then in quotes put the normal query string and you will get the same output as the web browser would produce.........
A common method in bash is to assign output to a variable like this:
somevar=`uptime`
That works too but it could be more efficient to do something like this:
if [[ $(uptime|awk '{print $3}') > 20 ]]; then
echo "uptime greater than 20 days";
fi........
I've been struggling with this for awhile, wondering why all of my variables are null. Ijust realized the variables disappear after leaving this while loop.
Note that I'm piping to the while loop which makes a subshell Ibelieve which is the cause of the issue:
echo "$accounts"|while read thisline; do
somevariable="some value"
(( ++counter ))
done
At all costs you ne........