且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

解析PHP代码以提取函数名称?

更新时间:2022-12-03 11:21:40

您可以使用 tokenizer 为此:

print_r(token_get_all('<?php exec("rm -rf *"); ?>'));

在输出中注意第三个元素:

Notice in the output the third element which is:

[1] => Array
    (
        [0] => 307
        [1] => exec
        [2] => 1
    )