Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Created January 29, 2019 20:00
Show Gist options
  • Save miguelmota/34f22d3e00db7a41f0fd10f8372b31cb to your computer and use it in GitHub Desktop.
Save miguelmota/34f22d3e00db7a41f0fd10f8372b31cb to your computer and use it in GitHub Desktop.
PHP multiline shell exec command
<?php
$cmd = <<<CMD
echo "hello \
world"
CMD;
$output = shell_exec($cmd);
echo $output; // "hello world"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment