<?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';
if (preg_match_all($regex, 'printr(abc,assdd)', $matches)) {
print_r($matches);
}