Just found myself needing to display bytes in a human readable format. There are countless examples that use a lot of complex techniques to achieve this, but I wanted a simpler solution. This is the method that came to mind. Rather than basing my algorithm on the numeric value, it is based on the length of the bytes.
Posts Tagged ‘function’
I’ve never really had a need to write code to uppercase only sentences in a string, but I now am dealing with large blocks of text content that is often written all uppercase by the author. So I popped on over to the PHP manual. I was pretty certain no such function existed in the language, but thought I’d check if one was added in a newer version.
Alas, no such function existed, so I wrote one myself Read the rest of this entry »