I have a PHP file with PHP Variables inside.
Example:
Hi =$username?>,
Can you please send me an email ?
I would like to
Depending on the expected accuracy a bit token_get_all() traversal will get you a list of variable basenames:
print_r(
array_filter(
token_get_all($php_file_content),
function($t) { return $t[0] == T_VARIABLE; }
)
);
Just filter out [1] from that array structure.
A bit less resilient, but sometimes still appropriate is a basic regex, which also allows to extract array variable or object syntax more easily.