jones jones - 6 months ago 28
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 /(\([^\(\)]+\))/