note 58503 deleted from function.strtoupper by nlopess

From: Date: Sun, 20 May 2007 13:40:35 +0000
Subject: note 58503 deleted from function.strtoupper by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-126722@lists.php.net to get a copy of this message
Note Submitter: Static Bit ---- function UpperPerCent($str) { $len = 0; $upper = 0; for ($i = 0; $i < strlen($str); ++$i) { if ($str[$i] <> strtolower($str[$i])) { ++$len; ++$upper; } if ($str[$i] <> strtoupper($str[$i])) { ++$len; } } $per_cent = 0; if ($len > 0) $per_cent = ($upper/$len)*100; return $per_cent; }

« previous php.notes (#126722) next »