Code Fragments
These are small, useful code fragments that J’raxis has collected from time to time. Due to their rather obvious simplicity, these code fragments are all released into the public domain.
- commify()
- Inserts commas into numbers.
- Available in:
- duration()
- Converts seconds into [d+]hh:mm:ss representation.
- Available in:
- bcduration()
- Converts seconds into [d+]hh:mm:ss representation.
- This version of duration() uses PHP’s BC math functions to handle large numbers.
- Available in: