Re: Parse string with variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Merlin schrieb:
Hi there,

I am trying to parse a plain text which contains variables. The string looks like this:

P=1
U=test
T=ok
P=2
U=test2
T=anything

How could I create arrays out of this. To be able to access the values like this:
echo $P[1];

parse_str does not work here and I could not find another function which does this.

Thank you for any hint,

Merlin

quite less infos you give.

echo $P[2] would output test or what?
$U["test"] or $U[1] = test ??

a hint. Uhm, use regexpressions to split the string and form variables out of it.

my guess.

Barry

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux