Jump to content

Only Postive Numbers


JustinK101

Recommended Posts

I need a function that does the following:

 

input    output

-3        0

-2        0

-1        0

0          0

1          1

2          2

 

Basically returns only positive numbers, so not absolute value. If the number is negative, simply return 0. Is this a built in function into php? Thanks.

Link to comment
https://forums.phpfreaks.com/topic/193728-only-postive-numbers/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.