|
|
|
จากโค้ดด้านล่างมีทางทำให้สั้นและเข้าใจง่ายกว่านี้มั้ยครับ |
|
|
|
|
|
|
|
ถ้าทำงานได้ก็โอเคแล้วครับ
|
|
|
|
|
Date :
2017-03-21 15:33:50 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
$a = array("121/54-1312-060-03-1(30)", "121/54-1312-060-03-2(30)", "121/54-1312-060-03-3(30)", "121/54-1312-060-03-4(30)");
$x = "121/54-1312-060-03-";
$y = "(30)";
$z = array();
foreach($a as $i){
$z[] = str_replace(array($x,$y),'',$i);
}
echo $x.implode(',',$z).$y;
|
|
|
|
|
Date :
2017-03-21 22:43:30 |
By :
num |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|