|
 |
|
อยากได้ code แปลงข้อมูล คือข้อมูลจากฐานข้อมูล 3,000.00 อยากให้แปลงเป็น 3000 |
|
 |
|
|
 |
 |
|
มีใครอยู่ไหม ช่วยด้วยค่ะ วันนี้ต้องส่งงานแล้ว
|
 |
 |
 |
 |
Date :
2009-10-26 07:46:02 |
By :
aung |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$value_room = number_format(3000, 2, '.', ',');
echo $value_room;
|
 |
 |
 |
 |
Date :
2009-10-26 07:58:14 |
By :
DownsTream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<?php
echo str_replace(',','','3,000');
?>
<br />
<script>
var x = '3,000,000'.replace(/,/g,'');
document.write(x);
</script>
|
 |
 |
 |
 |
Date :
2009-10-26 08:54:45 |
By :
num |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอา ชัดๆ เลยพี่ ของเดิม <?=$value_room ?> มันแสดง 3,000.00
แล้วเปลี่ยนยัง ไง
|
 |
 |
 |
 |
Date :
2009-10-26 09:09:56 |
By :
aung |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<?php echo str_replace(',','',$value_room); ?> ครับ
|
 |
 |
 |
 |
Date :
2009-10-26 09:12:48 |
By :
num |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
การขอความเห็น หรือขอให้แสดงความคิดเห็น ไม่ควรเขียนเชิงบังคับครับ เพราะนั่น... จะเสี่ยงต่อการถูกเดินผ่านกระทู้อ่ะครับ
|
 |
 |
 |
 |
Date :
2009-10-26 09:18:48 |
By :
deawx |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณค่าที่เตือน

แต่ที่code มา มันก็ยังแสดง เป็ฯ 3,000,00 นะค่ะ ทำไงดี
|
 |
 |
 |
 |
Date :
2009-10-26 10:40:40 |
By :
aung |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วค่ะ ขอบคุณมาก 
|
 |
 |
 |
 |
Date :
2009-10-26 10:43:11 |
By :
aaa |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|