Код: Выделить всё
key=value, key2=value2
Код: Выделить всё
array(
"key" => "value",
"key2" => "value2"
)
Код: Выделить всё
$parts = explode(",", $string)
$parts = array_map("trim", $parts);
foreach($parts as $currentPart)
{
list($key, $value) = explode("=", $currentPart);
$keyValues[$key] = $value;
}
Подробнее здесь: https://stackoverflow.com/questions/492 ... ciative-ar