Link to home
Start Free TrialLog in
Avatar of tomp_gl
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
ASKER CERTIFIED SOLUTION
Avatar of tg_wilk
tg_wilk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tomp_gl
tomp_gl

ASKER

I resolved the problem using strpos and looping.

Thanks