everybody_stand_back_lead
10 Sep 2009

PHP Regex to Make Twitter Links Clickable

This is just a quicky post, not one of my usual long, rambling diatribes. This week is madness, even by my own absurd standards, but I didn’t want to miss jotting this down in case it might be helpful to others.

69
27 Jun 2002

Displaying file sizes in human readable format

This code prints out “b” for bytes, “m” for megs, etc depending on the file size.

0
27 Jun 2002

Truncate text to x number of words

This code will truncate given text to a certain length, adding “…” where it’s been truncated. For example: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque ac urna a erat pharetra placerat. Sed at tortor id lacus pellentesque malesuada. Suspendisse vitae dui vel velit tincidunt aliquet. Cras condimentum lobortis

0