Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2005
    Location
    New York
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    <TEXTAREA> to Rows ?

    Hi guys,

    What do you think the best way to get data from a <TEXTAREA> line by line is ?

    Right now I do something like this:

    $arrData=explode("\r\n",$_POST['frmInput']);

    ...using '\r\n' as the delimiter. It works but maybe there is a better way ?

    Thanks.

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Location
    West Midlands, UK
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't think there is another way, since the only delimeter is the newline it seems as good a way as any. I'm not sure "\r\n" is the best for portable code, though. I think (not 100% sure) that "\r\n" is windows, "\r" is mac and "\n" is *nix, so it might be worth throwing in some extra checking if you want portable code, but otherwise if it works it works


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •