[PHP] problems with replacing line breaks

2002-03-01 Thread Tom Kincaid

I'm trying to replace line breaks with html code and am having problems. For 
single lines preg_replace("/\n/","",$text) or
ereg_replace("\n","",$text) adds the  but doesn't remove the line 
break. While preg_replace("/\n\n/","",$text) doesn't find any double line 
breaks, even though they're there. Why doesn't this work?




_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] words for pspell

2002-03-02 Thread Tom Kincaid

I'm trying to use pspell for a forum. It works great, but I can't quite 
figure out how to pull individual words out of a string for it. preg_match 
("/\b.+?\b/", $text, $matches) works almost perfectly, EXCEPT apostrophes 
are word boundaries so the string "Shouldn't this work?" would have 
"Shouldn" as the first word. Has anyone ever implemented something like 
this? Any advice?

THanks for this and thanks to everyone who helped with the preg_replace. It 
was actually part of this.

_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php