Recent changes Random page
GAMING
Technology
 
Gaming
Entertainment
Science Fiction
Biggest wikis
Hobbies
Music
See more...

Strtoupper

from PHPWiki - the free guide to PHP.

Jump to: navigation, search

Returns a given string with all alphabetic characters converted to uppercase.

Contents

[edit] Arguments

{{{return}}} {{{name}}} ({{{params}}})

[edit] Argument Inclusion

  • strtoupper needs PHP version 4 or 5 to work.

[edit] Return values

strtoupper will return the given string with all alphabetic characters converted to uppercase. According to the php manual 'alphabetic' is determined by the current locale. So umlaut-a (รค) or other special characters from different languages might not get converted.

[edit] Examples

[edit] Example 1: The direct way

<?php
 echo strtoupper("I am Small");
?>

[edit] Output

I AM SMALL

[edit] Example 2: Using a variable

<?php
 $string = "special chars (#*+...) AND UPPERCASE STAY untouched!";
 echo strtoupper($string);
?>

[edit] Output

SPECIAL CHARS (#*+...) AND UPPERCASE STAY UNTOUCHED!
For more details on this function, visit its entry in the php manual.
Rate this article:
Share this article: