|
 |
|
ทำ - php ให้ไม่มีติดลบยังไงหรอครับ คือ 11-15 มันจะเท่ากัน -4 ใช่ไหมครับ เเต่ผมอยากให้มันเป็น 0 เเทนอ่ะครับ เขียนประมาณไหนหรอครับ |
|
 |
|
|
 |
 |
|
ใช้ if คับ
5555
|
 |
 |
 |
 |
Date :
2013-11-17 17:49:36 |
By :
pjgunner.com |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ให้มันลบแต่ผลลบไม่ต่ำกว่า 0 ลองเขียนให้ดูหน่อยได้ไหมครับ
|
 |
 |
 |
 |
Date :
2013-11-17 18:24:21 |
By :
aibot |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองนั่งคิดนอนคิดดูคับ เด๋วก็ได้
|
 |
 |
 |
 |
Date :
2013-11-17 18:48:28 |
By :
pjgunner.com |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
sprintf unsigned
|
 |
 |
 |
 |
Date :
2013-11-17 19:45:31 |
By :
PlaKriM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
    
|
 |
 |
 |
 |
Date :
2013-11-17 23:06:53 |
By :
itpcc |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
กระทู้ explode ว่าแย่แล้ว อันนี้แย่กว่า
บ่องตง ไปทำอย่างอื่นเหอะนาย
|
 |
 |
 |
 |
Date :
2013-11-17 23:45:11 |
By :
555 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
//$result = (11 - 15 < 0) ? 0 : 11 - 15;
$result = ($a - $b < 0) ? 0 : $a - $b;
|
 |
 |
 |
 |
Date :
2013-11-18 07:49:50 |
By :
ห้ามตอบเกินวันละ 2 กระทู้ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|