tomp_gl
asked on
How do I use strcspn() to extract values in an SQL argument?
Hi,
I'm trying to extract MySQL insert values into a PHP array. Each field value is delimited by a comma, though surrounding each comma can be a single quote, a closed bracket, an uppercase letter denoting the start of a MySQL function or an integer. Finding the start and end of each value is made more complicated by concatenated values. I don't want to use regex as I need greater efficiency for this particular code and was looking into strcspn - can anyone show me some code demonstrating strcspn splitting an SQL expression?
Thanks
I'm trying to extract MySQL insert values into a PHP array. Each field value is delimited by a comma, though surrounding each comma can be a single quote, a closed bracket, an uppercase letter denoting the start of a MySQL function or an integer. Finding the start and end of each value is made more complicated by concatenated values. I don't want to use regex as I need greater efficiency for this particular code and was looking into strcspn - can anyone show me some code demonstrating strcspn splitting an SQL expression?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks