How can I extract a list of function names from a PHP file as a text string?

Solution:

To list all available functions in PHP, you can loop through all loaded extensions and use get_extension_funcs():


<?php
foreach (get_loaded_extensions() as $module) {
    echo "<pre>";
    print_r(get_extension_funcs($module));
    echo "</pre>";
}
?>

Note: Language constructs like echo, die, unset, etc., are not functions, so they won’t appear in this list.

Reference: PHP Reserved Keywords