Hello! my problem: i've got some data in a file like this:
[Age] gerhard,26 susanne,25
[Birth] gerhard,1980 susanne,1985
and i need the following output:
gerhard,26,1980 susanne,25,1985
how can a manage this in php? thank you, franz
Is it against the rules to alter your files slightly. You are so close to an ini file format it seems a pity not to go all the way.
A minor change to
[Age] gerhard=26 susanne=25
[Birth] gerhard=1980 susanne=1985
will make life a lot easier. For example with [man]parse_ini_file[/man]
$ini = parse_ini_file('myfilename', true); $name='gerhard'; echo $name . ' ' . $ini['Age'][$name] . ',' . $ini['Birth'][$name];
hth