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)));
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.

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

Reply via email to