Re: [PHP] About Guest Book\'s messages....

2003-05-29 Thread Lew Mark-Andrews
>I used wordwrap($word,40,"\n",1) to prevent it, >but my system is BIG5 ,two bytes, >Sometimes this method would destroy the structure >of the two-bytes word. Hi, Have you looked into the multi-byte string functions in the manual? Search on php.net for mb_str . Also, have you tried just forcing

Re: [PHP] About Guest Book\'s messages....

2003-05-28 Thread Jason k Larson
Greetings, How about some simple word detection attempts like: $words = explode (' ',$input); //create array $new_words = ''; //empty foreach ($words as $word) { if (strlen ($word) <= 40)) { $word = wordwrap ($word,40,"\n",1); } $new_words .= ' '.$word; //add word(s) to string } $new_words