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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 23:01:33 2025 UTC