|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15286 ucwords doesn't work with capitalized string
Submitted: 2002-01-29 17:44 UTC Modified: 2002-01-29 18:15 UTC
From: jim_ekleberry at hotmail dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.1.1 OS: Win2K SP2
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: jim_ekleberry at hotmail dot com
New email:
PHP Version: OS:


 [2002-01-29 17:44 UTC] jim_ekleberry at hotmail dot com
$propercompany = ucwords("WOLF PACK TRADERS");

$propercompany should be "Wolf Pack Traders"

I am running PHP v4.1.1 with:
System Windows NT 5.0 build 2195 
Build Date Dec 30 2001 
Server API CGI 
Virtual Directory Support enabled 
Configuration File (php.ini) Path C:\WINNT\php.ini 
ZEND_DEBUG disabled 
Thread Safety enabled 

And using IIS 5.0

I know that this problem is mentioned in the documentation but I did not find an actual bug report when I searched the bug database to actually have it fixed.

Jim Ekleberry


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-29 18:15 UTC]
This is expected behavior, not a bug.

$str = 'McDonalds';

You want ucwords($str) to result in Mcdonalds?  If so, use strtolower() first as the documentation suggests.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 22 03:01:29 2024 UTC