Here are some PHP Functions I've Created & Decided To Share!

Hey, if you don't think they aren't useful... oh-well :-p I created them for specific needs in my daily PHP Developement.

If you find yourself needing to use one... you can do so SO LONG AS (1) you email me and let me know which function you've used and what script it is being used in, and (2) keep my header/copyright within your source-code!

Here is a friendly script to try to correct some common TLD typos within email addresses:

// // - History: // 7/15/2007 3:26 AM - Created /////////////////////////////////////////////////////////////////////// function correctEmailTLDs($str_input) { // requiredField($str_input, 'No Email Address Provided'); validateEmailAddress($str_input); // if ( substr($str_input, -3) == 'cmo' ) { return substr($str_input, 0, -3) . 'com'; } elseif ( substr($str_input, -3) == 'moc' ) { return substr($str_input, 0, -3) . 'com'; } elseif ( substr($str_input, -3) == 'ocm' ) { return substr($str_input, 0, -3) . 'com'; } elseif ( substr($str_input, -3) == 'nte' ) { return substr($str_input, 0, -3) . 'net'; } elseif ( substr($str_input, -3) == 'ten' ) { return substr($str_input, 0, -3) . 'net'; } elseif ( substr($str_input, -3) == 'etn' ) { return substr($str_input, 0, -3) . 'net'; } elseif ( substr($str_input, -3) == 'ogr' ) { return substr($str_input, 0, -3) . 'org'; } elseif ( substr($str_input, -3) == 'rog' ) { return substr($str_input, 0, -3) . 'org'; } elseif ( substr($str_input, -3) == 'gor' ) { return substr($str_input, 0, -3) . 'org'; } else { return $str_input; } // }




You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser