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

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

2003-05-28 Thread fongming
Hi, sir: I tried it but also failed. For One Chinese Character is composed with two bytes, and between every word and word in a line, there is no space " ",(Not like english). For example: English's thank you is : Thank you very much! Chinese's thank you is : ¯uªº¦hÁ±z¤F¡I and some word's sec

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

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

2003-05-28 Thread fongming
Hi, Sir: There may be someone leave a message like following: U and it expand the width of