What is the best way to parse a string containing a function call with parameters in PHP so that I have the function name and the parameters with their correct types. Example:
$string = "ask('Do you want to continue?', ['yes', 'no'])";
I don't want to directly call that function, so eval is not an option. I want to do something based on the function name and use the parameters with their correct types. Is there an easy way in PHP?
I expect something like this as a result:
$name = 'ask';
$parameters = ['Do you want to continue?', ['yes', 'no']];