I could have these strings:
- “volume asc, edition desc”
- “volume ASC, othercolumn desc, columnx DESC”
I want obtain arrays like these:
- array( ‘volume’, ‘asc’, ‘edition’, ‘desc’ );
- array( ‘volume’, ‘asc’, ‘othercolumn’, ‘desc’, ‘columnx’, ‘desc’ );
How to reach that with regexp/preg_match functions?
You could use preg_split:
output: