Re: RES: Case Conversion of US Person Names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jul 16, 2009, at 1:19 PM, Jônatas Zechim wrote:

U can try this:

function fNme($n){
	$tN=count($n=explode(' ',strtolower($n)));
	$nR='';
	
for($i=0;$i<$tN;$i++){if($i==0){$nR.=strlen($n[$i])>3?ucwords($n [$i]):$n[$i]
;}else{$nR.=strlen($n[$i])>3?' '.ucwords($n[$i]):' '.$n[$i];}}
	return $nR;
}
	
echo fNme('aaaaa aaa aaaaaa aa aaaa');

And also make an array inside this function for exceptions like 'vander' or
other words which the srtlen is > 3.


Thank you. If I "roll my own" function, that could be useful.

I'd still rather find one that exists, though.

Ken
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux