I have a PHP file with PHP Variables inside.
Example:
Hi <?=$username?>,
Can you please send me an email ?
I would like to list from an outside file, every PHP variables in this file.
Something that would return:
Array(
'username'
);
I know there is a PHP function called get_defined_vars, but this is an external file.
Is there a way to get all PHP vars from an external file ?
Thank you
Use
file_get_contents()andpreg_match_all():