I want to split a string, using either explode or preg_split most likely, to create two arrays. The first is what was split up. The seconds is the delimiters. The only two delimiters would be either "AND" or "OR".
For example:
$string = "Name=John AND State=GA OR State=CA";
I want to capture not only the 'Name=John,State=GA,State=CA' but also the delimiters between each.
For this example, the two seperate arrays would be:
array (
[0] => Name=John
[1] => State=GA
[2] => State=CA
)
and
array (
[0] => AND
[1] => OR
)
From here I can massage the data to comply with what I want, in the end to build a query. If there's a better way of going about this I'm all ears. Thanks for any and all help!