Posted by Zilla on 09/21/05 14:58
Damien wrote:
> Hi to all,
> I would like to get field values from a multi-line text.
>
> For instance :
> "
> Name: Mr Smith
> Address: Paris
> "
>
Im not sure what you want, but if you want to get the different lines in
different variables, then you can use the explode()-function to split
the string:
$lines = explode("\n", $string);
The above code would give an array $lines where each array-element
contains one line of $string.
If $string contains
"Name: Mr Smith
Address: Paris"
then $lines[0] contains "Name: Mr Smith" and $lines[1] contains
"Address: Paris".
More information on the explode()-function: www.php.net/explode
Zilla
[Back to original message]
|