Link to home
Start Free TrialLog in
Avatar of Ludwig Diehl
Ludwig DiehlFlag for Peru

asked on

PHP preg_split

Hi everyone. I am looking for a way to split two kind of strings into assoc arrays:

1.
Let
a = 1 AND b = "text0" OR c = "text1"

Should produce:
[
 'a' => 1,
 'b' => "text0",
 'c' => "text1"
]

2.
Let
a = 1,b = "text0",c = "text1"

Should produce:
[
 'a' => 1,
 'b' => "text0",
 'c' => "text1"
]
ASKER CERTIFIED SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

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 Ludwig Diehl

ASKER

Thank you!....I actually thought about something like that, I was trying to get it using only preg_split.  Thank you
preg_split will never result in an associative array.