Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force Uppercase...

Status
Not open for further replies.

rjonesX

Technical User
Jun 18, 2001
56
US
Sorry to do it in this forum, but I only know how to do this in Perl and thought maybe someone in here knows Perl and PHP...

In perl you can force uppercase for the first letter of a string by using the \u command.

Any idea how to accomplish this in php?
 
ucfirst is right e.g.
Code:
$foo = 'hello world!';
$foo = ucfirst($foo);             // Hello world!

$bar = 'HELLO WORLD!';
$bar = ucfirst($bar);             // HELLO WORLD!
$bar = ucfirst(strtolower($bar)); // Hello world!
take a look at PHP Conversion Utils
there's all sorts of other string conversion tools there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top