|
 |
|
อยากทราบวิธีการเพิ่มข้อมูลแบบคีย์หลักร่วม และค้นหาข้อมูลจากฐานข้อมูลแล้วนำรหัสที่ค้นหาเจอเก็บอีก 1 ตารางในแต่ละครั้งที่ค้นหาเจอคะ |
|
 |
|
|
 |
 |
|
Code (PHP)
<?php
$str = 'one|two|three|four';
// positive limit
print_r(explode('|', $str, 2));
// negative limit (since PHP 5.1)
print_r(explode('|', $str, -1));
?>
ผลลัพธ์
Array
(
[0] => one
[1] => two|three|four
)
Array
(
[0] => one
[1] => two
[2] => three
)
|
 |
 |
 |
 |
Date :
2012-02-24 14:35:00 |
By :
teukkead |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลอง print_r ดูแล้ว
ได้อาเรย์ออกมาเป็นยังไงครับ
|
 |
 |
 |
 |
Date :
2012-02-24 14:58:09 |
By :
adaaugusta |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คุณกะล่อน หายไปนานน่ะครับ 
|
 |
 |
 |
 |
Date :
2012-02-24 14:59:52 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่ได้อยู่ดีคะ เด๋วจะลองใหม่
|
 |
 |
 |
 |
Date :
2012-02-24 16:46:44 |
By :
ชีโร้ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|