Re: How can I separate strings entered by new line

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

 



On Fri, Jul 21, 2006 at 10:24:18PM -0700, abhishek jain wrote:
> Hi Raj,
> see http://in2.php.net/manual/en/function.preg-split.php . preg_split
> is the function you are looking for.
> i think the following line would do (unless there are syntax error)
> $string = "example-1.com ..... ";
> $ret = preg_split("/[\r\n]/s",$string);

What about "\n" and "\r"?

Shouldn't be $ret = explode("\r\n", $string); be preferred regarding
performance?

Regards,
Martin


------------------------ Yahoo! Groups Sponsor --------------------~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

PHP Data object relational mapping generator
http://www.metastorage.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux