php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62127 array_change_key_case first letter
Submitted: 2012-05-23 17:03 UTC Modified: 2012-05-24 10:19 UTC
From: michael at hscbrasil dot com dot br Assigned:
Status: Not a bug Package: Arrays related
PHP Version: Irrelevant OS: CentOS 5.5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: michael at hscbrasil dot com dot br
New email:
PHP Version: OS:

 

 [2012-05-23 17:03 UTC] michael at hscbrasil dot com dot br
Description:
------------
I was trying to use array_change_key_case to convert Array keys to a Lower Case. An error occurs in keys with accent on the first letter.

PHP Version 5.2.10

Test script:
---------------
$arr = array
(
	'Última Atualização' => 'Última Atualização',
	'IP' => 'IP',
	'Ônibus' => 'Ônibus',
	'MSN' => 'MSN'
);

print 'normal = '.var_export($arr, true);

print 'lower = '.var_export(array_change_key_case($arr, CASE_LOWER), true);

/*
normal = array (
  'Última Atualização' => 'Última Atualização',
  'IP' => 'IP',
  'Ônibus' => 'Ônibus',
  'MSN' => 'MSN',
)
lower = array (
  'Última atualização' => 'Última Atualização',
  'ip' => 'IP',
  'Ônibus' => 'Ônibus',
  'msn' => 'MSN',
)
*/


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-24 10:19 UTC] johannes@php.net
-Status: Open +Status: Not a bug
 [2012-05-24 10:19 UTC] johannes@php.net
Set a proper locale using setlocale() also 5.2.10 is out of support for long
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Oct 28 03:01:23 2020 UTC