<?php
$test = <<<_END
intKey=6 , floatKey=12.34, simpleString=simple_value , booleanValue=true ,
quotedString="test\"value", singlQuoted='singlQuotedValue',nullValue=null
_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);
PD9waHAKZXJyb3JfcmVwb3J0aW5nKC0xKTsKCiR0ZXN0ID0gPDw8X0VORAppbnRLZXk9NiAsIGZsb2F0S2V5PTEyLjM0LCBzaW1wbGVTdHJpbmc9c2ltcGxlX3ZhbHVlICwgYm9vbGVhblZhbHVlPXRydWUgLCAKcXVvdGVkU3RyaW5nPSJ0ZXN0XCJ2YWx1ZSIsIHNpbmdsUXVvdGVkPSdzaW5nbFF1b3RlZFZhbHVlJyxudWxsVmFsdWU9bnVsbApfRU5EOwoKZnVuY3Rpb24gcGFyc2VTdHJpbmcoJGluY29taW5nU3RyaW5nKSB7CgkkcmVzdWx0ID0gW107CgkkcGFydHMgPSBwcmVnX3NwbGl0KCcvLC91JywgJGluY29taW5nU3RyaW5nLCAwLCBQUkVHX1NQTElUX05PX0VNUFRZKTsKCQoJZm9yZWFjaCAoJHBhcnRzIGFzICRwYXJ0KSB7CgkJJHRlbXBTdHJpbmcgPSB0cmltKCRwYXJ0KTsKCQkkYnJva2VuU3RyaW5nID0gcHJlZ19zcGxpdCgnLz0vdScsICR0ZW1wU3RyaW5nLCAwLCBQUkVHX1NQTElUX05PX0VNUFRZKTsKCQkkcmVzdWx0WyRicm9rZW5TdHJpbmdbMF1dID0gJGJyb2tlblN0cmluZ1sxXTsKCX0KCXJldHVybiAkcmVzdWx0Owp9CgokYSA9IHBhcnNlU3RyaW5nKCR0ZXN0KTsKcHJpbnRfcigkYSk7Cg==