- preg_match: documentation ( source)
- print_r: documentation ( source)
<?php
//$regex = '/(?P<function_name>.*?)\s*\((?P<parameters>.*?)\)\s*/i';
$regex = '/(?P<function_name>.+)\s*\((?P<parameters>[^)]+)/';
//$regex = '/(?P<function_name>.+)\s*\((?P<parameters>.*?)\)\s*/i/';
preg_match($regex, 'printr("abc", "assdd")', $matches);
print_r($matches);