[PHP] Re: Removing Empty Lines from Text??

2002-06-24 Thread BB
$var = preg_replace(/\n*/,\n,$var); Jason Caldwell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is there an elegant way to remove excess blank lines from my form data? For example; if someone enters the following text and then press' the Submit button:

[PHP] Re: Removing Empty Lines from Text??

2002-06-24 Thread BB
replace that with $var = preg_replace(/\n+/,\n,$var); Bb [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... $var = preg_replace(/\n*/,\n,$var); Jason Caldwell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is there an elegant way

[PHP] Re: Removing Empty Lines from Text??

2002-06-24 Thread Jason Caldwell
neither worked. any other suggestions? Bb [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... replace that with $var = preg_replace(/\n+/,\n,$var); Bb [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... $var =

[PHP] Re: Removing Empty Lines from Text??

2002-06-24 Thread BB
$var = preg_replace(/[\r\n]+/,\n,$var); Jason Caldwell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... neither worked. any other suggestions? Bb [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... replace that with $var =

[PHP] Re: Removing Empty Lines from Text??

2002-06-24 Thread Tracker 1
$strMine = preg.replace(/(\r\n|\r|\n)+/,$strMine,\r\n\r\n); or \n\n as the replace.. :) I use the (\r\n|\r|\n) to match against windows, unix, mac line terminations... I usually replace with the windows \r\n -- === Michael

[PHP] Re: Removing Empty Lines from Text??

2002-06-24 Thread Tracker 1
would suggest /(\r\n|\r|\n)+/ especially if the input is from a browser that could be mac, or windows.. :) -- === Michael J. Ryan - tracker1[*at*]theroughnecks.com Roughneck BBS: http://www.theroughnecks.net