|
 |
|
ช่วยหน่อยคับจนปัญาจริงๆเกี่ยวกับวันที่ ภาษาไทยคับ ผมเพิ่งเขียน code webboard ใหม่อะคับ |
|
 |
|
|
 |
 |
|
ผมเพิ่งเขียน code webboard ใหม่อะคับ แต่ว่าวันที่มันแสดงไม่ครบและไม่เป็นภาษาไทยเหมือนที่ตั้งไว้อะคับ
อันนี้ผลลัพธ์ที่มันแสดงคับ
#11 ทดสอบ ทดสอบ 2552
#10 test2 test 2552
ไฟล์ question_veiw.php
Code (PHP)
<?
include "connect.php";
include "function.php";
$sql="select * from tb_question order by id_ques desc";
$result = mysql_db_query($dbname,$sql);
mysql_query("SET NAMES TIS620") ;
echo "
<h3>Webboard ¡ÃзÙé ¶ÒÁ - µÍº </h3>
<a href ='question_form.php' > µÑ駤ӶÒÁãËÁè</a><p>
<table width='100%' border='1'>
<tr bgcolor='#d2e9ff'>
<td width='8%'><center><b><font size='2' face='ms sans serif'>ÃËÑÊ</font></b></center></td>
<td width='61%'><center><b><font size='2' face='ms sans serif'>ËÑÇ¢éͤӶÒÁ</font></b></center></td>
<td width='15%'><center><b><font size='2' face='ms sans serif'>¼ÙéµÑ駤ӶÒÁ</font></b></center></td>
<td width='16%'><center><b><font size='2' face='ms sans serif'>µÑé§àÁ×èÍÇѹ·Õè</font></b></center></td>
</tr> ";
while ($record=mysql_fetch_array($result))
{
$id_ques=$record [id_ques];
$title_ques=$record[title_ques];
$detail_ques=$record[detail_ques];
$name_ques=$record[name_ques];
$email_ques=$record[email_ques];
$date_ques=$record[date_ques];
$title_ques=htmlspecialchars ($title_ques);
$name_ques=htmlspecialchars ($name_ques);
$detail_ques=nl2br(htmlspecialchars ($detail_ques));
$date_ques =displaydate ($date_ques);
echo "
<tr bgcolor='#ffffff'>
<td width='8%'><center><font size='2' face='ms sans serif'>#$id_ques</font></center></td>
<td width='61%'><font size='2' face='ms sans serif'><a href ='answer_view.php?id_ques=$id_ques'>$title_ques</a></font></td>
<td width='15%'><center><font size='2' face='ms sans serif'>$name_ques</font></center></td>
<td width='16%'><center><font size='2' face='ms sans serif'>$date_ques</font></center></td>
</tr>";
} //end while
echo "</table>";
?>
ไฟล์ function.php
Code (PHP)
<?
function displaydate ($x) {
$thai_m=array("Á¡ÃÒ¤Á","¡ØÁÀҾѹ¸ì","ÁÕ¹Ò¤Á","àÁÉÒ¹","¾ÄÉÀÒ¤Á","ÁԶعÒ¹","¡Ã¡®Ò¤Á","ÊÔ§ËÒ¤Á","¡Ñ¹ÂÒ¹","µØÅÒ¤Á","¾ÄȨԡÒ¹","¸Ñ¹ÇÒ¤Á");
$date_array=explode(" - " ,$x);
$y=$date_array[0];
$m=$date_array[1]-1;
$d=$date_array[2];
$m=$thai_m[$m];
$y=$y+543;
$displaydate=" $d $m $y";
return $displaydate;
}
function checkemail ($checkemail)
{
if (eregi( "^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$", $checkemail) )
{
return true;
} else
{
return false;
}
}
?>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-10-10 21:53:29 |
By :
aody |
View :
809 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คงใช้ dream กด ctrl + j
เลือก title/encoding ที่เป็น thai
ถ้ามันยังไม่เป็นภาษาไทย พิมพ์ใหม่ครับ
|
 |
 |
 |
 |
Date :
2009-10-10 22:00:15 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$date_array=explode(" - " ,$x);
แนะนำให้ใช้
$date_array = preg_split('/-/', $x);
|
 |
 |
 |
 |
Date :
2009-10-10 22:01:59 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เปิดด้วยโปรแกรม EditPlus แล้ว Save as ใหม่ครับ
กำหนด Converter เป็น UTF-8
|
 |
 |
 |
 |
Date :
2009-10-10 22:02:25 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากคับคุณ เอี่ยว ใช้ได้แล้ว ขอบคุณจิงๆๆคับ และก็ตอ้งขอบคุณเว็บ thaicreate,com ด้วยคับที่มีบอร์ดที่ให้ความรู้จิงๆๆคับ
|
 |
 |
 |
 |
Date :
2009-10-11 11:59:43 |
By :
aody |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|