View Full Version : Stipping off Xtra carrige returns.

fritz Jung
07-24-2002, 08:57 PM

I have a message system working... and can't figure out how to automatically trim off the extra carrige returns folks typically generate....

I am only interested in stripping off ALL carrige returns BEYOND the last LETTER that they type.



07-25-2002, 12:56 AM
This should do the trick:

$txt = preg_replace('/\s*$/s', '', $txt);

- Mark

07-25-2002, 02:40 AM
or avoiding regex where possible....


loot at ltrim(); and rtrim(); as well but trim strips whitepace and newlines etc from the beginning and end of a string.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum