Re: [PHP] Multiple substring replacement

2004-05-24 Thread hitek
why not use nl2br() ? At 01:28 PM 5/24/2004, GodFoca wrote: What's the best way of replacing every ocurrence of a substring in a LARGE string by another (longer) substring? Specifically, I have read the contents of a file into a tring with fread, and now I want to replace all "\n" with "" Thanks in

Re: [PHP] Multiple substring replacement

2004-05-24 Thread Red Wingate
In this special case you would even use 'file' to read the content of the file into an array and use 'implode' to replace every \n with $content = implode( "" , file ( './my_file.txt' ) ); -- red Brent Baisley wrote: Normally, I would say str_replace(), but for converting "\n" to "", use the nl2

Re: [PHP] Multiple substring replacement

2004-05-24 Thread Brent Baisley
Normally, I would say str_replace(), but for converting "\n" to "", use the nl2br() function. On May 24, 2004, at 4:28 PM, GodFoca wrote: What's the best way of replacing every ocurrence of a substring in a LARGE string by another (longer) substring? Specifically, I have read the contents of a f