<?php
$test = <<<_END
intKey=6 , floatKey=12.34, simpleString=simple_value , booleanValue=true ,
quotedString="test\"value", singlQuoted='singlQuotedValue',nullValue=null,
willItWork="a=1,b=2,c=3"
_END;
function parseString($incomingString) {
$result = [];
$parts = preg_split('/,/u', $incomingString, 0, PREG_SPLIT_NO_EMPTY
);
foreach ($parts as $part) {
$tempString = trim($part); $brokenString = preg_split('/=/u', $tempString, 0, PREG_SPLIT_NO_EMPTY
); $result[$brokenString[0]] = $brokenString[1];
}
return $result;
}
$a = parseString($test);
PD9waHAKZXJyb3JfcmVwb3J0aW5nKC0xKTsKCiR0ZXN0ID0gPDw8X0VORAppbnRLZXk9NiAsIGZsb2F0S2V5PTEyLjM0LCBzaW1wbGVTdHJpbmc9c2ltcGxlX3ZhbHVlICwgYm9vbGVhblZhbHVlPXRydWUgLCAKcXVvdGVkU3RyaW5nPSJ0ZXN0XCJ2YWx1ZSIsIHNpbmdsUXVvdGVkPSdzaW5nbFF1b3RlZFZhbHVlJyxudWxsVmFsdWU9bnVsbCwKd2lsbEl0V29yaz0iYT0xLGI9MixjPTMiCl9FTkQ7CgpmdW5jdGlvbiBwYXJzZVN0cmluZygkaW5jb21pbmdTdHJpbmcpIHsKCSRyZXN1bHQgPSBbXTsKCSRwYXJ0cyA9IHByZWdfc3BsaXQoJy8sL3UnLCAkaW5jb21pbmdTdHJpbmcsIDAsIFBSRUdfU1BMSVRfTk9fRU1QVFkpOwoJCglmb3JlYWNoICgkcGFydHMgYXMgJHBhcnQpIHsKCQkkdGVtcFN0cmluZyA9IHRyaW0oJHBhcnQpOwoJCSRicm9rZW5TdHJpbmcgPSBwcmVnX3NwbGl0KCcvPS91JywgJHRlbXBTdHJpbmcsIDAsIFBSRUdfU1BMSVRfTk9fRU1QVFkpOwoJCSRyZXN1bHRbJGJyb2tlblN0cmluZ1swXV0gPSAkYnJva2VuU3RyaW5nWzFdOwoJfQoJcmV0dXJuICRyZXN1bHQ7Cn0KCiRhID0gcGFyc2VTdHJpbmcoJHRlc3QpOwpwcmludF9yKCRhKTsK