Level 27
@deekshith You could do the following:
preg_match('/\[WpProQuiz\s(.*?)\]/', '... [WpProQuiz 2265]', $matches)
Then $matches[1] contains the number you want.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi. I have a content like below,
Hope you enjoy this quiz. If you like it, then please share it. Thank you. [WpProQuiz 2265]
Here i want fetch only [WpProQuiz 2265] if it matches and get the number 2265.
How to do this?
@deekshith You could do the following:
preg_match('/\[WpProQuiz\s(.*?)\]/', '... [WpProQuiz 2265]', $matches)
Then $matches[1] contains the number you want.
Please or to participate in this conversation.