|
 |
|
เช็คบ๊อกอีกครั้ง ไม่ทราบว่าเช็คบ็อกสามารถส่งสองค่าพร้อมกันได้หรือไม่ |
|
 |
|
|
 |
 |
|
ทุก form element ก็ส่งได้ตัวล่ะ 1 ค่าข้อมูลครับ ถ้าจะส่งหลายค่า ก็เอามาต่อกันเอาครับ
|
 |
 |
 |
 |
Date :
2009-08-04 15:39:14 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
นั่นละครับ พอต่อกันแล้ว เราจะแยก แล้วเอามาใช้อย่างไร พี่ช่วยตอบผมหน่อย
ขอบคุณคับ ขอตัวอย่างเล็ก ๆน้อย หน่ะพี่หน่ะ
|
 |
 |
 |
 |
Date :
2009-08-04 16:05:18 |
By :
chaiwit |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
explode
|
 |
 |
 |
 |
Date :
2009-08-04 16:13:50 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตัวอย่าง ใช้ - เป็นตัวต่อและตัวตัด
Code (PHP)
<input name="c" type="checkbox" value="aaa-bbb" />
<?php
$c = $_POST['c'];
$arr = explode("-",$c);
for($i=0;$i<count($arr;$i++)
{
echo "\$arr[$i] = ".$arr[$i] ."<br>";
}
?>
|
 |
 |
 |
 |
Date :
2009-08-04 16:17:28 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
- ตัวต่อมันเป็นแบบนี้นี่เอง อิอิ 
วิ่งซิครับ ตัวใครตัวมันแต่ตัวต่อต่อย 
|
 |
 |
 |
 |
Date :
2009-08-04 16:19:26 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อ่านะ คุณ PlaKriM 
แก้นิดนึงครับ
for($i=0;$i<count($arr);$i++)
|
 |
 |
 |
 |
Date :
2009-08-04 16:44:43 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับพี่ ปรับใช้แล้วครับ แหร่มเลย เป็นเช่นนี้แล
Code (PHP)
<?php
foreach ($_POST['content_id'] as $value) :
list ($value,$value1) = explode('-',$value);
echo $value."<br>";
echo $value1."<br>";
endforeach;
?>
|
 |
 |
 |
 |
Date :
2009-08-05 08:55:03 |
By :
chaiwit |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|