PHP 8.4.24 Released!

Voting

: six plus zero?
(Example: nine)

The Note You're Voting On

Carel at divers information with dotcom
19 years ago
I made a small change. Now it takes care of points in numbers

function ucsentence ($string){
   $string = explode ('.', $string);
   $count = count ($string);
   for ($i = 0; $i < $count; $i++){
       $string[$i]  = ucfirst (trim ($string[$i]));
       if ($i > 0){
           if ((ord($string[$i]{0})<48) || (ord($string[$i]{0})>57)) {
              $string[$i] = ' ' . $string[$i];
           }   
       }
   }
   $string = implode ('.', $string);
   return $string;
}

<< Back to user notes page

To Top