PHP script to properly format phone numbers

Summary: One of the biggest challenges as a programmer lies in the fact that you have to think ahead for your users so that things work seamlessly.  On any site involving input fields that interact with a database, it is critical that the information be validated before going into the database, and with a bit of forethought you can make sure that the inputs are not only valid, but in a standardized format. Consider phone numbers as an example.  If you ask 10 people to write down their phone numbers, you might get several different responses:

  • 555.5555
  • 555-5555
  • 555.555.5555
  • 555-555-5555
  • (555)555.5555
  • (555)555-5555
  • 5555555
  • 5555555555
  • 1.555.555.5555
  • 1-555-555-5555
  • 1(555)555.5555
  • 1(555)555-5555
You get the idea.
 
Concept:  While you could write code that forces users to type in the phone number a certain way, you can also... Read more »

How to Detect a Default Gravatar Image for an Email Address – PHP Tutorial

Summary:  Have you ever liked a site so much that you created an account on their website by giving them your email and creating a password, only to login and find that they already had a picture of you on file?  How do that do that?!   This intelligent design utilizes a free web service called Gravatar (or similar concept). Concept:  To obtain your Gravatar, use PHP to create the md5 hash of the email address of interest and append that hash to: gravatar.com/avatars/[insert-hash-here].jpg.  There are a lot of available options for the type of image that is called (by passing GET parameters) from the Gravatar servers that can adjust the size, type, etc of the image. Problem: I... Read more »

What’s so big about twitter?

cell phone with a twitter stickerLast night we, at Arcimedia, went to our second event hosted by the Social Media Club of Charleston.  While last month's gathering came down to a few getting-to-know-you beers during happy hour, yesterday's meeting format was more akin to an open-discussion, social networking symposium; with one word dominating most of the dialogue:  Twitter. It seems that there are still many people, those who are social networking engineers included, who still do not understand the big deal about Twitter.  Who cares?  Why do people enjoy it so much?  Where is the power? To answer this, let us go back to around 2002/2003 when Nextel came out with... Read more »