note 112329 added to function.ucfirst

From: Date: Sun, 02 Jun 2013 12:53:29 +0000
Subject: note 112329 added to function.ucfirst
Groups: php.notes 
Request: Send a blank email to php-notes+get-195029@lists.php.net to get a copy of this message
This function works great for me. But How would I make so it don't mess anything inside a html tags with urls. Its messing around with url's, its putting spaces in. Can any help. Just a waring. I only know basic php. :) 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: 69.147.83.199 Probable Submitter: 145.255.240.124 ---- Manual Page -- http://php.net/manual/en/function.ucfirst.php Edit -- https://master.php.net/note/edit/112329 Del: integrated -- https://master.php.net/note/delete/112329/integrated Del: useless -- https://master.php.net/note/delete/112329/useless Del: bad code -- https://master.php.net/note/delete/112329/bad+code Del: spam -- https://master.php.net/note/delete/112329/spam Del: non-english -- https://master.php.net/note/delete/112329/non-english Del: in docs -- https://master.php.net/note/delete/112329/in+docs Del: other reasons-- https://master.php.net/note/delete/112329 Reject -- https://master.php.net/note/reject/112329 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#195029) next »