Satisfactory that is to not go into functions that eat much time.
Format of the data:
It is basically similar to the HTML tag parameters, but not quite.
<name1=value1 name2=value2 [here can be any whitespace characters]
33=55 "name with spaces and ="="value with spaces and '" '"title"'="can't" "in
names"="and
values can be tabs and new lines"
double"and_single'quotes=are_allowed_in_names_and_values_if_there_is_no_whitespace_in_it
"escaping is ""sql-like"""='the same with ''single quotes'''
`third option`=`are "backticks" that also can be ``escaped```>
Is this format called somehow ? I ‘invented’ it myself but I highly doubt that no one came up with this idea before, maybe it (or very similar format, for example with slash escaping) already has a parsing function in php ?
If not, how to write my own, using regexes, string operations, some kind of buffers, accumulators ? I’ve never written any parser myself yet.
Try something like this:
which will print the following:
Use, and maintain, at your own risk!