I have a problem where I have no idea how to solve this and if regular expression are the best way. My idea is to get the name,variables,content of functions in a file. This is my regular expression:
preg_match_all('/function (.*?)\((.*?)\)(.*?)\{(.*?)\}/s',$content,$funcs,PREG_SET_ORDER);
And I have this testfile:
function testfunc($text)
{
if ($text)
{
return 1;
}
return 0;
}
Of course I will get everything until "}" before return 0; Is there a way to get everything in the function so find the right "}".