Re: Creating an Array from a Multi-line string (Help appreciated)
| From: | Bix | Date: | Wed, 12 Mar 2003 20:26:26 +0000 |
| Subject: | Re: Creating an Array from a Multi-line string (Help appreciated) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139382@lists.php.net to get a copy of this message | ||
Much appreciated!
Will give it a try.
Thanks ;o)
"Ernest E Vogelsinger" <ernest@vogelsinger.at> wrote in message
news:5.1.1.6.2.20030312212239.06cf9460@mail.vogelsinger.at...
> At 21:10 12.03.2003, Bix said:
> --------------------[snip]--------------------
> >I am creating an interface page with a multi line text box which will
> >recieve a list of phone numbers on individual lines, so:
> >
> >12345
> >12345
> >12345
> >and so on...
> >
> >I need to carry out an operation on each of these numbers (add them to a
> >mysql db, but thats not important).
> >
> >Is it possible to recieve this text box in my php script and reference
each
> >line? Ideally put it into an array and reference by $number['0']
> >$number['1'] and so on, so i can have a 'for' loop going?
> --------------------[snip]--------------------
>
> If you are certain that the lines are separated by a CR you could simply
use
> $phonearray = explode("\n", $_REQUEST['phones']);
>
>
> --
> >O Ernest E. Vogelsinger
> (\) ICQ #13394035
> ^ http://www.vogelsinger.at/
>
>