I have template files which use short tags <?= $some_var; ?>
. I need to write a script to get a list of the variables used in that template, i.e. an array like:
[
0 => '$some_var',
...
n => '$some_var_n'
]
I have tried:
preg_match_all('/<?[^p](.*)?>/s', $file_contents, $matches);
and some other various combinations but to no luck.
Thanks.