note 46996 deleted from function.strtoupper by tularis

From: Date: Fri, 29 Oct 2004 21:55:47 +0000
Subject: note 46996 deleted from function.strtoupper by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-79335@lists.php.net to get a copy of this message
Note Submitter: ---- for russian chars i used this (works for english as well): // DEFINE LETTERS define( LOWER_STR, 'abcdefghijklmnopqrstuvwxyzàáâãä叿çèéêëìíîïðñòóôõö÷øùúûüýþÿ' ); define( UPPER_STR, 'ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄŨÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞß' ); // TO LOWER CASE function toLower($string){ $string = trim(nohtml($string)); return strtr(nohtml($string), UPPER_STR, LOWER_STR ); } // TO UPPER CASE function toUpper($string){ $string = trim(nohtml($string)); return strtr($string, LOWER_STR, UPPER_STR ); } // TO UPPER CASE WORDS function toUWords($string){ $string = toLower($string); $arr = explode(" ", $string); for($i=0; $i<=count($arr)+1; $i++){ $new_str .= toUpper(substr($arr[$i],0,1)).toLower(substr($arr[$i],1))." "; } return(trim($new_str)); } ---- Reason: bad code

« previous php.notes (#79335) next »