Extracting function names from a file (with or without regular expressions)

后端 未结 4 2015
南旧
南旧 2020-12-20 06:59

How can I extract all function names from a PHP file?

The file has many functions that look more or less like the following. Is a regular expression the best way to

4条回答
  •  难免孤独
    2020-12-20 07:15

    You can write another PHP file to grep for that, or if you have Linux or Mac OS X, you can use something like:

    grep -P "function\s+\w" myfile.php
    

提交回复
热议问题