- Cell Phones 608
- Editors 245
- Education, Science & Engineering 289
- Games 1683
- Internet 547
- Mobile Software 24
- Multimedia & Graphics 1023
- PC 391
- Programming 345
- C# 77
- Data Bases 118
- PHP 54
- Miscellaneous 96
- Security 1372
- SEO 60
- Utilities 818
PHP output desired end depending on the number
Uploaded: 30.12.2013
Content: dendnya.zip 1,47 kB
Product description
Quite often you can see these phrases: time left to 1 days or before the opening left 2 hours. As it is not looks good and sounds one day or two hours. Especially not right!
I have written a function in php will be able to correct such sloppy. Function select (or choose) Need the end depending on the number and give it to you.
The file denDnya.php are two functions:
1. Function denDnya, which returns an array of words: the day, month, year, hours, minutes and seconds with the right endings depending on the number passed to the function.
2. Universal strEnd, which of the proposed options to select words with a suitable ending, depending on the number.
Additional information
The file has a description of the function and an example.
Unfortunately, I have not been consulted and do not give advice on the implementation of functions in the content management system (CMS). There is no opportunity and time. But they are quite simple to understand why by not difficult.
If you suddenly found a bug, be sure to tell me to fix!
Feedback
0Period | |||
1 month | 3 months | 12 months | |
0 | 0 | 0 | |
0 | 0 | 0 |