note 82041 added to function.ucwords

From: Date: Tue, 25 Mar 2008 19:53:10 +0000
Subject: note 82041 added to function.ucwords
Groups: php.notes 
Request: Send a blank email to php-notes+get-137571@lists.php.net to get a copy of this message
To capitalize e-mail address, I made this function. <?php function capitalize_email($email) { $domain = strtolower(strstr($email, '@')); $user = strtolower(substr($email, 0, strrpos($email, '@'))); $user = preg_replace('!((?:\b|_).)!e', 'strtoupper("$1");', $user); return $user.$domain; } echo capitalize_email('blabla.example@example.com'); // Blabla.Example@example.com ?> ---- Server IP: 69.147.83.197 Probable Submitter: 201.68.33.181 ---- Manual Page -- http://www.php.net/manual/en/function.ucwords.php Edit -- https://master.php.net/note/edit/82041 Del: integrated -- https://master.php.net/note/delete/82041/integrated Del: useless -- https://master.php.net/note/delete/82041/useless Del: bad code -- https://master.php.net/note/delete/82041/bad+code Del: spam -- https://master.php.net/note/delete/82041/spam Del: non-english -- https://master.php.net/note/delete/82041/non-english Del: in docs -- https://master.php.net/note/delete/82041/in+docs Del: other reasons-- https://master.php.net/note/delete/82041 Reject -- https://master.php.net/note/reject/82041 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#137571) next »