I’ve browsed quite a bit, but I’m unable to come up with a solution. I’m attempting to execute a mixed PHP/HTML stream directly from the command line, not from a file. I’m aware of the command line switches, -f (to execute from a physical file), and -r (to execute PHP only). Basically, I’m looking for the following functionality:
php -x "<html><head></head><body><?php echo 'Hello World'; ?></body></html>"
Note that -x is not a valid switch, and the argument is an arbitrary stream of characters with mixed HTML and PHP. The output of this program, would ideally be:
<html><head></head><body>Hello World</body></html>
You can use this:
Note that the first echo is a bash echo, not a php echo.