Copy code The code is as follows:
$data = php_strip_whitespace('test.php'); // Remove comments, spaces, and newlines (excluding those in strings)
echo $data;
$data = preg_match_all("
/
functions+ #Match function and following spaces
[a -zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]* #Match function name
(([^)]*?))s+ #Match function parameters and capture as sub-pattern
{
(.*?)
}(?=(?:s*function|s*?$)) #Match braces, only when followed by function or at the end of the string
/xi
", $data, $matches);
print_r($matches);
?>
http://www.bkjia.com/PHPjc/320554.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/320554.htmlTechArticleCopy the code as follows: ?php $data = php_strip_whitespace('test.php'); //Remove the comments, Space, newline (not included in string) echo $data; $data = preg_match_all(" / func...