php.net |  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
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: 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-29 18:15 UTC] philip@php.net
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-2019 The PHP Group
All rights reserved.
Last updated: Sat Oct 19 02:01:27 2019 UTC