1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-24 07:42:10 +01:00
Files
archived-doc-en/reference/strings/functions/strtoupper.xml
Tim Starling 54ff7bf8e0 Updates for RFC: Locale-independent case conversion (#1934)
* Add a detailed description of what is meant by ASCII case conversion
  to strtolower() and strtoupper().
* Replace locale-related text on ucfirst(), lcfirst() and ucwords()
  with text about ASCII case conversion.
* Remove entity note.locale-single-byte since it was only used on
  ucwords().
* Add changelog entries to all the functions mentioned in the RFC.

Co-authored-by: George Peter Banyard <girgias@php.net>
2022-11-07 14:17:15 +00:00

128 lines
3.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.strtoupper">
<refnamediv>
<refname>strtoupper</refname>
<refpurpose>Make a string uppercase</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>strtoupper</methodname>
<methodparam><type>string</type><parameter>string</parameter></methodparam>
</methodsynopsis>
<para>
Returns <parameter>string</parameter> with all ASCII alphabetic characters
converted to uppercase.
</para>
<para>
Bytes in the range <literal>"a"</literal> (0x61) to <literal>"z"</literal>
(0x7a) will be converted to the corresponding uppercase letter by subtracting
32 from each byte value.
</para>
<para>
This can be used to convert ASCII characters within strings encoded with
UTF-8, since multibyte UTF-8 characters will be ignored. To convert multibyte
non-ASCII characters, use <function>mb_strtoupper</function>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>string</parameter></term>
<listitem>
<para>
The input string.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the uppercased string.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
&strings.changelog.ascii-case-conversion;
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>strtoupper</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$str = "Mary Had A Little Lamb and She LOVED It So";
$str = strtoupper($str);
echo $str; // Prints MARY HAD A LITTLE LAMB AND SHE LOVED IT SO
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&note.bin-safe;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>strtolower</function></member>
<member><function>ucfirst</function></member>
<member><function>ucwords</function></member>
<member><function>mb_strtoupper</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->