Author Name Chris Fidao Social Media Image by https://annieruygtillustration.com/ $result = Process::run("php -v"); echo $result->output(); This uses https://symfony.com/doc/current/components/process.html under the hood, and adds a TON of quality-of-life improvements.
Let's run the ls -lah command to list out files in the current directory: $result = Process::run('ls -lah')
# Find the status of each app # The pipe `|` only get stdout content fly apps list -j | jq '.
// Get our list of apps as JSON and parse it in PHP $result = Process::run("fly apps list -j"); if ($result->successful()) { $apps = json_decode($result->output(), true); var_dump($apps); }