Skip to content
Advertisement

Extract Parameters from pdo query

I have this query using pdo:

how can I extract the parameters from this query with a regular expression in order to get an array similar to:

Advertisement

Answer

Try this on for size..

Here is a demo to this REGEX in action using regexr.com

http://regexr.com/39gnv

And here is a demo in PHP

test.php

Output of php test.php

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement