|
 |
|
แสดงข้อมูลที่เป็น array ให้มีลูกน้ำคั่น โค้ดตรงที่แสดงข้อมูลอ่ะ ตอนนี้ถ้ามันมีมากว่าหนึ่งไฟล์ มันแสดง aaabbb ติดกัน อยากให้มันแสดง aaa,bbb |
|
 |
|
|
 |
 |
|
$attch_array = explode(",", $data['file']);
while($element=each($attch_array)){
$attch=$element["value"];
$fileName=substr($attch,-4);
if($fileName==".txt"){ $txt_name = str_replace (".txt","",$attch);}
if($fileName==".pdf"){ $txt_name = str_replace (".pdf","",$attch);}
if($fileName==".xls"){ $txt_name = str_replace (".xls","",$attch);}
}
โค้ดตรงที่แสดงข้อมูลอ่ะ ตอนนี้ถ้ามันมีมากว่าหนึ่งไฟล์ มันแสดง aaabbb ติดกัน อยากให้มันแสดง aaa,bbb แบบมีลูกน้ำคั่นอ่ะค่ะ ทำไงช่วยหน่ยค่ะ
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-03-18 16:06:01 |
By :
PookPik |
View :
1358 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$attch_array = explode(",", $data['file']);
$no = 0; // เพิ่ม
while($element=each($attch_array))
{
$attch=$element["value"];
$fileName=substr($attch,-4);
if($fileName==".txt"){ $txt_name = str_replace (".txt","",$attch);}
if($fileName==".pdf"){ $txt_name = str_replace (".pdf","",$attch);}
if($fileName==".xls"){ $txt_name = str_replace (".xls","",$attch);}
if($no > 0) $txt_name .=',';
$no++; //เพิ่ม
}
|
 |
 |
 |
 |
Date :
2009-03-18 17:17:31 |
By :
mee079 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณค่ะ
|
 |
 |
 |
 |
Date :
2009-03-19 10:01:38 |
By :
PookPik |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|