I am Hack Sparrow
Captain of the Internets.

iName – PHP Function to Format and Generate iProduct Names

The iName is a commercial PHP function used for formatting and generating product names which comply to the iProduct naming convention. According to the iProduct naming convention, the name of the product should be prefixed with a lowercase "i" followed immediately by the capitalized normal name of the product. The iProduct naming convention was pioneered by Steve Jobs at Apple.Examples of products which comply to the iProduct naming convention:

  • iMac
  • iPhone
  • iCamera
  • iLaptop
  • iPant
  • iPad
The iName function formats any word that has an "i" at the beginning of the word, into an iProduct name. If the iName discovers that the given name does not contain an "i" at the beginning of the word, it will add the "i" and return a well formatted iProduct name for you.Can't wait to get your hands dirty with the iName? The revolutionary piece of code follows right below.
/** * The iName function is used for formatting words into the iProduct naming convention: iPhone, iMac, iCam, iShirt etc. * @$name The name which you want to format to iProduct naming convention. $name can be in any case combination. */function iName($name) {    $first_letter = strtolower(substr($name, 0, 1));    if ($first_letter == 'i') {            $name = strtolower(substr($name, 1));                $iName = 'i' . ucfirst($name);    }    else {        $iName = 'i' . ucfirst(strtolower($name));    }    return $iName;}
And this is how you use the iName function.
$normal_name = 'iflower';$iName = iName($normal_name);echo $iName; // iFlower
Try passing these names to the iName function: ilight, IINTELIGGENT, Phone, mobile, iPAD, shoe, JeANs. You will be amazed how accurate the iName is in formatting the names to the iProduct naming convention!Now, before you get a little too excited, I would like to remind you again that the iName is NOT FREE! That means you have to pay me money to use the code in your projects. In case you plan to use the iName in commercial projects, it will cost you $99.99/server. If you plan to use the iName in personal or not-for-profit projects, you MUST donate me atleast $5 (donate more to support the iName project). For licensing details get in touch with me today!Warning: Porting this function to other programming languages is against the law.

Make a Comment