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.
php, scripts, cli, variables, query, stringthe, quot, binary, install, cgi, apt, yourscript, somevar, anothervar, anotherthing, quotes, output, browser,