在php文件目录中查找函数中的参数实例

I have a directory with a number of php files, there is a function getOpt() that’s used in most of the files, with different parameters. For example:

getOpt(sometext) 

or

getOpt(sometext, someothertext)

or

getOpt(sometext2)

I'm trying to get anything that's in the parenthesis and figure out which files it pops up in and if possible how many times.

For example the output I'm trying achieve would look something like this:

"sometext" is used in x.php (2 times), y.php (1 times), z.php (4 times)

"sometext2" is used in y.php(1 times), z.php (3 times)

etc...

Is this something that can be done with a lengthy grep command?

I've tried:

grep -o -a -m 1 -h -r “getOpt(*” . | head -1 > ouput.txt

But I'm not sure how to capture until the close parenthesis, instead of the first instance of the function name. How else could I go about this?