Having an issue getting a gitt diff output to be stored as an array in PHP.
$modifiedFiles = `git diff --cached --name-only --diff-filter=ACMR HEAD -- '*.php'`;
var_dump($modifiedFiles);
OUTPUT:
"""
app/Http/Controllers/HomeController.php
app/Http/Controllers/LawyerController.php
"""
I then tried:
$modifiedFiles = explode('
', $modifiedFiles);
var_dump();
Output:
array(1) {
[0]=>
string(82) "app/Http/Controllers/SomeFile.php
app/Http/Controllers/OtherFile.php
"
}
I just want the output to be a PHP array of files. Any tips?