Ludwig Diehl
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"
]
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
preg_split will never result in an associative array.
ASKER