note 100849 added to function.mb-convert-case

From: Date: Wed, 10 Nov 2010 21:33:08 +0000
Subject: note 100849 added to function.mb-convert-case
Groups: php.notes 
Request: Send a blank email to php-notes+get-173929@lists.php.net to get a copy of this message
Sub-functions related to and used by function titleCase() // Only oddity here was "Y" - based on info here (http://answers.yahoo.com/question/index?qid=20081118115039AApZFuv) // I'm treating it as a vowel in all cases, because it would only NOT be a vowel if it was next to another vowel // and if that happens, then the word has at least that other vowel; so, the end result of this function would be correct function hasVowels($str) { $str = " " . $str; $retVal = stripos($str, "a") || stripos($str, "e") || stripos($str, "i") || stripos($str, "o") || stripos($str, "u") || stripos($str, "y"); return $retVal===true; } // Does word/string have any characters that are numbers (e.g., "P24") - different than "is_numeric()" function hasNums($str) { $len = strlen($str); $hasNums = false; $pos = 0; while ($pos < $len && ! $hasNums) { $c = substr($str, $pos, 1); $hasNums = is_numeric($c); $pos++; } return $hasNums; } // Is word/string completely alphabetic (no numbers, no punctuation, etc.) // Wraps existing PHP function with something more akin to PHP's related functions that determine string content type function isAlpha($str) { return ctype_alpha($str); } ---- Server IP: 69.147.83.197 Probable Submitter: 74.231.57.2 ---- Manual Page -- http://www.php.net/manual/en/function.mb-convert-case.php Edit -- https://master.php.net/note/edit/100849 Del: integrated -- https://master.php.net/note/delete/100849/integrated Del: useless -- https://master.php.net/note/delete/100849/useless Del: bad code -- https://master.php.net/note/delete/100849/bad+code Del: spam -- https://master.php.net/note/delete/100849/spam Del: non-english -- https://master.php.net/note/delete/100849/non-english Del: in docs -- https://master.php.net/note/delete/100849/in+docs Del: other reasons-- https://master.php.net/note/delete/100849 Reject -- https://master.php.net/note/reject/100849 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#173929) next »