|
 |
|
ต้องการแยกข้อมูลที่อยู่ในฟิลด์หนึ่ง ออกมาเป็น 2 ฟิลด์ จะได้หรือไม่ ?? |
|
 |
|
|
 |
 |
|
Code (PHP)
<?php
$data = "aewewe--20022009";
list($sn, $date) = explode("--", $data);
$realdate = substr($date,4,4) . "-" . substr($date,2,2) . "-" . substr($date,0,2);
echo $sn;
echo $realdate;
?>
|
 |
 |
 |
 |
Date :
2009-04-20 17:49:47 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<?php
$s = "Q111316--19072007";
$str = explode("--",$s);
print_r($str);
?>
|
 |
 |
 |
 |
Date :
2009-04-20 17:52:33 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอขอบคุณ พี่ PlaKriM อย่างสูง ที่กรุณาช่วยเหลือมาตลอด
และขอขอบคุณ พี่ a-mac ด้วยเช่นกัน หวังเป็นอย่างยิ่งว่าโอกาสผมอาจจะรบกวนอีกนะครับ เพราะโปรแกรมยังไม่เสร็จ ต้องรีบส่งหัวหน้างานภายในสิ้นเดือนนี้แล้วนะครับ...
|
 |
 |
 |
 |
Date :
2009-04-20 21:18:14 |
By :
pukmtec |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|