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
 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Wed Nov 13 08:01:29 2024 UTC