note 110261 added to function.ucfirst

From: Date: Fri, 05 Oct 2012 16:14:21 +0000
Subject: note 110261 added to function.ucfirst
Groups: php.notes 
Request: Send a blank email to php-notes+get-191150@lists.php.net to get a copy of this message
Simple but workable solution: mb_internal_encoding("UTF-8"); // before calling the function function utf8_ucfirst($str){ preg_match_all("~^(.)(.*)$~u", $str, $arr); return mb_strtoupper($arr[1][0]).$arr[2][0]; } ---- Server IP: 69.147.83.199 Probable Submitter: 85.160.50.34 ---- Manual Page -- http://www.php.net/manual/en/function.ucfirst.php Edit -- https://master.php.net/note/edit/110261 Del: integrated -- https://master.php.net/note/delete/110261/integrated Del: useless -- https://master.php.net/note/delete/110261/useless Del: bad code -- https://master.php.net/note/delete/110261/bad+code Del: spam -- https://master.php.net/note/delete/110261/spam Del: non-english -- https://master.php.net/note/delete/110261/non-english Del: in docs -- https://master.php.net/note/delete/110261/in+docs Del: other reasons-- https://master.php.net/note/delete/110261 Reject -- https://master.php.net/note/reject/110261 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#191150) next »