Function list of php file

前端 未结 12 1283
南方客
南方客 2020-11-28 14:40

How to get list of functions that are declared in a php file

12条回答
  •  無奈伤痛
    2020-11-28 15:13

    Finding string (eg. Function names) in a file is simple with regex. Just read the file and parse the content using preg_match_all.

    I wrote a simple function to get list of functions in a file.

    https://gist.github.com/komputronika/f92397b4f60870131ef52930faf09983

    $a = functions_in_file( "mylib.php" );
    

提交回复
热议问题