note 73040 added to function.strtoupper

From: Date: Wed, 07 Feb 2007 06:37:28 +0000
Subject: note 73040 added to function.strtoupper
Groups: php.notes 
Request: Send a blank email to php-notes+get-123031@lists.php.net to get a copy of this message
function to convert string to correct caps. Based on previous note. echo transform_small_caps('dr. j. p. wolfewitz at www.askapache.com'); // returns Dr. J. P. Wolfewitz At Www.askapache.com function transform_small_caps($string){ $words=''; $final=''; $words = explode(" ", $string); for($i=0; $i<count($words); $i++) { $string = strtolower($words[$i]); $string = substr_replace($string, strtoupper(substr($string, 0, 1)), 0, 1); $final .= "$string "; } return $final; } ---- Server IP: 216.194.113.175 Probable Submitter: 24.172.164.205 ---- Manual Page -- http://www.php.net/manual/en/function.strtoupper.php Edit -- https://master.php.net/note/edit/73040 Del: integrated -- https://master.php.net/note/delete/73040/integrated Del: useless -- https://master.php.net/note/delete/73040/useless Del: bad code -- https://master.php.net/note/delete/73040/bad+code Del: spam -- https://master.php.net/note/delete/73040/spam Del: non-english -- https://master.php.net/note/delete/73040/non-english Del: in docs -- https://master.php.net/note/delete/73040/in+docs Del: other reasons-- https://master.php.net/note/delete/73040 Reject -- https://master.php.net/note/reject/73040 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#123031) next »