php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #51858 mb_convert_case example is not the best
Submitted: 2010-05-19 10:52 UTC Modified: 2010-05-19 11:44 UTC
From: dani88elx at gmail dot com Assigned: aharvey (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2010-05-19 10:52 UTC] dani88elx at gmail dot com
Description:
------------
Example on mb_convert_case() does not show the utility of the function, since the sample text has no accents or special characters.

It will be useful a comparison with strtoupper() / strtolower()

I proppose the following better examples:

$str= "Thís is à tëxt with çpécýal châráctèrs";
echo strtoupper($str); //prints a corrupted text in UTF: TH�S IS � T�XT WITH �P�C�AL CH�R�CT�RS
echo mb_convert_case($str, MB_CASE_UPPER, "UTF-8"); // prints a valid upper case conversion in UTF: THÍS IS À TËXT WITH ÇPÉCÝAL CHÂRÁCTÈRS

$str = "mary had a Little lamb and she loved it so";
echo = mb_convert_case($str, MB_CASE_TITLE, "UTF-8"); // prints: Mary Had A Little Lamb And She Loved It So


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-19 10:58 UTC] dani88elx at gmail dot com
sh**! last line should be

echo mb_convert_case($str, MB_CASE_TITLE, "UTF-8"); // prints: Mary Had A Little Lamb And She Loved It So
 [2010-05-19 11:12 UTC] aharvey@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: aharvey
 [2010-05-19 11:44 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=299482
Log: Fix doc bug #51858 (mb_convert_case example is not the best) by adding some
examples to the manual pages for mb_convert_case, mb_strtoupper and
mb_strtolower that use multi-byte characters (specifically Greek).
 [2010-05-19 11:44 UTC] aharvey@php.net
-Status: Assigned +Status: Closed
 [2010-05-19 11:44 UTC] aharvey@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 11:01:31 2024 UTC