unparse()
unparse(array $keyValueArray, string $keyValueDelimiter = ":", string $listDelimiter = ",") : string
Parameters
array | $keyValueArray | |
string | $keyValueDelimiter | |
string | $listDelimiter |
Class KeyValueStringParser
KeyValueStringParser is a parser for strings of the form
key1<delimiterA>value1<delimiterB>key2<delimiterA>value2<delimiterB>
For instance
id=1,name=doe,firstname=john
'
, "
), leading and trailing
whitespace will be preserved (leading/trailing, quotes will be removed from value).
parse(string $keyValueString, string $keyValueDelimiter = ":", string $listDelimiter = ",", string $valueMode = KVP_VALUE_GIVEN) : array
Parse key/value pairs string and returns them as an assoc array
Hint $keyValueString: "a:1,b:2,c:,d", "," (empty key AND empty value)
string | $keyValueString | string of key/value pairs. E.g.: 'a=100,b=test' |
string | $keyValueDelimiter | |
string | $listDelimiter | |
string | $valueMode |
|
Thrown if there is a value but no key.
associative array indexed by keys