|
 |
|
อยากถามเรื่องการเว้นบรรทัด ผมกรอกข้อมูลลงฟอร์มแล้วโดยในฟอร์มก็เว้นบรรทัดให้พอเก็บเข้าฐานข้อมูลแล้ว |
|
 |
|
|
 |
 |
|
<?
echo nl2br($data);
?>
|
 |
 |
 |
 |
Date :
2009-02-28 23:49:34 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากครับแต่ว่าเราต้องใส่ก่อนเข้าดาต้าเบสหรือว่าใส่ตอนเรียกให้มันโชว์ขึ้นมาอะครับ
|
 |
 |
 |
 |
Date :
2009-03-01 00:40:08 |
By :
zandztormz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คือฟังชั่นที่ให้มาต้องกดenterถึงจะขึ้นแต่ในแบบฟอร์มของผมเวลาสุดบรรทัดมันจะเว้นมาให้เองแต่เมื่อโชว์ออกมามันก็ไม่เว้นให้อะครับขอบคุณที่ช่วยสละเวลามาตอบครับ
|
 |
 |
 |
 |
Date :
2009-03-01 00:46:44 |
By :
zandztormz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใส่ตอน โชว์ครับ ตอน insert มันจะเป็น \n หรือ \r\n
nl2br จะแปลงจาก \n หรือ \r\n เป็น <br>
|
 |
 |
 |
 |
Date :
2009-03-01 00:48:01 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แล้วค่าของฟอร์มต้องตั้งอะไรหรือเปล่าครับผมพิมสุดบรรทัดแล้วมันจะเว้นลงมาแต่พอโชว์ก็ไม่เว้นให้ แต่ถ้าผมกดenterในการเว้นแทนไม่ให้รอจนสุดบรรทัดเวลาโชว์มาก็เว้นให้ปรกติครับ งงมาก
|
 |
 |
 |
 |
Date :
2009-03-01 00:57:35 |
By :
zandztormz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมก็เริ่มงงคำถามครับ
|
 |
 |
 |
 |
Date :
2009-03-01 01:17:24 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คือฟังค์ชั่นที่ให้มามันใช้ได้ต่อเมื่อเรากดenterเพื่อเริ่มใหม่บรรทัดใช่ไหมครับ แต่ของผมมันเป็นฟอร์มให้กรอกอะครับพอสุดบรรทัดก็จะเริ่มบรรทัดใหม่ลงมาให้เองแต่เมื่อผมกรอกลงฟอมแล้วเก็บข้อมูลลงฐานข้อมูลเรียบร้อยแล้วและนำมาโชว์ดูปรากฎว่ามันก็ไม่เว้นบรรทัดใหม่ให้ตามที่เว้นในแบบฟอร์มให้อะครับ เข้าใจยังครับ-.- ขอบคุณมากๆครับที่ช่วยสละเวลามาตอบครับ
|
 |
 |
 |
 |
Date :
2009-03-01 01:37:50 |
By :
zandztormz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าภาษาไทยคงเป็นไปได้ยาก ถ้าจะตัดจริงๆ มันอาจจะไม่เป็นคำ แต่ภาษาอังกฤษคงไม่มีปัญหาอะไรมากนัก
ลองดูนี่ครับ นี่ครับ
|
 |
 |
 |
 |
Date :
2009-03-01 01:51:50 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
โอ้วขอบคุณมากๆครับ
|
 |
 |
 |
 |
Date :
2009-03-01 02:52:52 |
By :
zandztormz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เขียน Code ให้เต็ม ๆ ครับ
Code (PHP)
<html>
<head>
<title>ThaiCreate.Com PHP & writefile</title>
</head>
<body>
<?
$strFileName = "thaicreate.txt";
$objFopen = fopen($strFileName, 'w');
$strText1 = "I Love ThaiCreate.Com Line1\r\n";
fwrite($objFopen, $strText1);
$strText2 = "I Love ThaiCreate.Com Line2\r\n";
fwrite($objFopen, $strText2);
$strText3 = "I Love ThaiCreate.Com Line3\r\n";
fwrite($objFopen, $strText3);
if($objFopen)
{
echo "File writed.";
}
else
{
echo "File can not write";
}
fclose($objFopen);
?>
</body>
</html>
|
 |
 |
 |
 |
Date :
2009-03-01 08:05:30 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|