Level 20
Use exec
exec('git log --pretty=oneline', $output);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I want to capture the output of a command and use it in PHP.
To be more specific: I want to run a git log --pretty=oneline, capture the output of this command and feed it to the @slack Blade directive.
Is there a simple way to do that?
Thanks!
Please or to participate in this conversation.