# [patch] Allow array_change_key_case to support ucfirst and lcfirst

- Thread: https://externals.io/message/45626
- Original archive: https://news-web.php.net/php.internals/45626
- Started by Matthew Fonda on 2009-09-22T17:15:54+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #45626 — Matthew Fonda — 2009-09-22T17:15:54+00:00

URL: https://externals.io/message/45626#45626

Hi All,

I came across a situation where I had to make the first character of an
arrays keys uppercase, and found the array_change_key_case function, but
noticed it only supported `CASE_UPPER` and CASE_LOWER. Attached is a patch to
also add support for CASE_LCFIRST and CASE_UCFIRST.

The patch is against PHP_5_3. I wasn't sure which branch I should write it
for--let me know if it should be against another branch. This is my first
patch submission so any comments are appreciated.

Regards,
--Matthew

---

## #45630 — Jani Taskinen — 2009-09-22T19:27:33+00:00

URL: https://externals.io/message/45626#45630 · In reply to: #45626

Matthew Fonda wrote:
> Hi All,
> 
> I came across a situation where I had to make the first character of an 
> arrays keys uppercase, and found the array_change_key_case function, but 
> noticed it only supported `CASE_UPPER` and CASE_LOWER. Attached is a patch 
> to also add support for CASE_LCFIRST and CASE_UCFIRST.
> 
> The patch is against PHP_5_3. I wasn't sure which branch I should write 
> it for--let me know if it should be against another branch. This is my 
> first patch submission so any comments are appreciated.

New stuff -> HEAD only (aka trunk :)

--Jani
