jones jones - 8 months ago 39
PHP Question

PHP how to get string between the last nested `(` , and `)`?

I have some mysql statement like bellow:

GROUP_CONCAT(CONCAT_WS("=",DATE_FORMAT(ca.`date`,'%Y-%m-%d'),sa.`precence`)) as attendence

Above statement is a sample, what i would to do is, to take every thing between the last nested parentheses
How to do that with regex or another ways ?


You can try this regex /(\([^\(\)]+\))/