Download the PHP package hyqo/pair without Composer
On this page you can find all versions of the php package hyqo/pair. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package pair
parse_pair(string $string): array
Why not parse_str?
Because parse_str
works only with a URL query string format.
So foo="bar"
will be parsed like
We have double-quoted value "bar"
. Instead, you can use parse_pair
and if value is a valid double-quoted it will be
expanded
Install
Usage
If string is valid, it will be parsed:
string | key | value |
---|---|---|
foo= |
foo |
empty string |
foo="" |
foo |
empty string |
foo=bar |
foo |
bar |
foo="bar" |
foo |
bar |
foo='bar' |
foo |
bar |
foo="\"bar\"" |
foo |
"bar" |
foo="\"bar" |
foo |
"bar |
foo="multi\nline" |
foo |
multi line |
foo='multi\nline' |
foo |
multi line |
If string is invalid, result will be null
:
string |
---|
foo="bar\" |
foo='bar\' |
foo="bar"" |
foo='bar'' |
All versions of pair with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.2|^8.0
The package hyqo/pair contains the following files
Loading the files please wait ....