- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$regex = '~
function #function keyword
\s* #any number of whitespaces
(?P<function_name>.*?) #function name itself
\s* #optional white spaces
(?P<parameters>\(.*?\)) #function parameters
\s* #optional white spaces
(?P<body>\{.*?\}) #body of a function
~six';
preg_match_all($regex, 'printr(abc,assdd)', $matches);
print_r($matches);