 |
มีปัญหาเกี่ยวกับ การตัดคำภาษาไทยคับ wordwrap และ iconv_substr |
|
 |
|
|
 |
 |
|
เขียนสดนะคับ ว่างจัด 
Code (PHP)
<?
//ะต้องการให้ขึ้นบรรทัดใหม่ ตัวอักษรที่ 60 ต้องเขียน wordwrap แทรก ยังไงคับ
$txt = "(Personality test II) Answers are for who you are now...... not who you were in the past. Have pen or pencil and paper ready. This is a real test given by the Human Relations Dept. at many of the major corporations today. It helps them get better insight";
$aa = strlen($txt);
$j = 0;
for($i = 0;$i<=$aa-60;)
{
$arr[$j] = substr($txt, $i,60).'<br>';
$str = $arr[$j];
echo $str;
$j = $j+1;
$i = $i+60;
}
?>
|
 |
 |
 |
 |
Date :
2011-05-19 15:35:24 |
By :
TEST_CODE |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขออีกนิดคับ ตอนนี้ผมใช้ code แบบนี้คับ
wordwrap(substr($rowwn['detail'],0,200)."...",65,"<br>\n",1);
พอการแสดงผลภาษาไทย มันมีเครื่องหมายประหลาดโผล่มาด้วย ต้องแก้ไข ยังไงคับ
ตัวอย่าง
ผ่านพ้นไปแล้วครับการแ�
�่งขัน Medalist Darts Challenges
ครั้งที่ 1
เมเจอร์ปิ่นเกล้า
ถือได�...
|
 |
 |
 |
 |
Date :
2011-05-19 15:59:14 |
By :
ballnaha |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|