Re: explode string at new line
| From: | Chris | Date: | Wed, 06 Jun 2007 03:18:04 +0000 |
| Subject: | Re: explode string at new line | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-256151@lists.php.net to get a copy of this message | ||
Davi wrote:
Em Terça 05 Junho 2007 23:52, heavyccasey@gmail.com escreveu:If it's coming from a <textarea> you'll want to use "\r\n" because a textarea uses both a carriage return (\r) and newline (\n) to separate. Otherwise each element of the array will have a \r on the end which may end up causing you some issues later on. -- Postgresql & php tutorials http://www.designmagick.com/That's exactly correct. Except I /think/ you should use "\n" instead of '\n'.Thank you for the reply... =) I'll check this... BTW: array explode ( string $delimiter, string $string [, int $limit] ) So, I was wrong... The right way, probaly, is: $str=explode("\n",$_POST["my_text"]);