note 83613 added to function.ucfirst

From: Date: Wed, 04 Jun 2008 14:57:12 +0000
Subject: note 83613 added to function.ucfirst
Groups: php.notes 
Request: Send a blank email to php-notes+get-140120@lists.php.net to get a copy of this message
This function capitalizes Swedish characters _and_ the usual characters that ucfirst() capitalizes. I use it to get a dynamic header at http://www.antonagestam.se , but I don't want swedish characters in the URL or in the filenames. [= <?php function capitalize ( $text ) { $swechars = array( "å", "ä", "ö" ); $uppercaseswechars = array( "Å", "Ä", "Ö" ); $text = str_replace( $swechars, $uppercaseswechars, $text { 0 } ) . substr( $text, 1 ); return ucfirst( $text ); } ?> ---- Server IP: 212.63.193.10 Probable Submitter: 85.224.207.253 ---- Manual Page -- http://www.php.net/manual/en/function.ucfirst.php Edit -- https://master.php.net/note/edit/83613 Del: integrated -- https://master.php.net/note/delete/83613/integrated Del: useless -- https://master.php.net/note/delete/83613/useless Del: bad code -- https://master.php.net/note/delete/83613/bad+code Del: spam -- https://master.php.net/note/delete/83613/spam Del: non-english -- https://master.php.net/note/delete/83613/non-english Del: in docs -- https://master.php.net/note/delete/83613/in+docs Del: other reasons-- https://master.php.net/note/delete/83613 Reject -- https://master.php.net/note/reject/83613 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#140120) next »