- 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>[^)]+)\s*/i';
//$regex = '/(?P<function_name>.+)\s*\((?P<parameters>.*?)\)\s*/i/';
preg_match($regex, 'HOUR(`date`, \'abc1234\')', $matches);
print_r($matches);