Blog Archives

Javascript – Pretty Array to Human Readable String

To take a JS array like [“item1”, “item2”, “item3″….] into a nice human readable string of “item1, item2 & item3” with all the first items getting comma separated and the final one with an ampersand use: resultString = array.length >

Posted in javascript, servers Tagged with: , , , , ,

PHP String->Decimal->String

I needed to turn a string into a decimal, for creation of a unique ID and be able to reverse it. To turn string to decimal, we convert it to ASCII char codes, then concat the whole mess together. I

Posted in PHP Tagged with: ,