note 72185 added to function.ucfirst
| From: | Carelatdiversinformationwithdotcom at osu1 dot php dot net | Date: | Sat, 06 Jan 2007 10:55:16 +0000 |
| Subject: | note 72185 added to function.ucfirst | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-121350@lists.php.net to get a copy of this message | ||
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;
}
----
Server IP: 194.109.193.94
Probable Submitter: 82.170.189.170
----
Manual Page -- http://www.php.net/manual/en/function.ucfirst.php
Edit -- https://master.php.net/note/edit/72185
Del: integrated -- https://master.php.net/note/delete/72185/integrated
Del: useless -- https://master.php.net/note/delete/72185/useless
Del: bad code -- https://master.php.net/note/delete/72185/bad+code
Del: spam -- https://master.php.net/note/delete/72185/spam
Del: non-english -- https://master.php.net/note/delete/72185/non-english
Del: in docs -- https://master.php.net/note/delete/72185/in+docs
Del: other reasons-- https://master.php.net/note/delete/72185
Reject -- https://master.php.net/note/reject/72185
Search -- https://master.php.net/manage/user-notes.php