mirror of
https://github.com/php/doc-zh.git
synced 2026-03-26 08:02:16 +01:00
121 lines
3.0 KiB
XML
121 lines
3.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- $Revision$ -->
|
||
<!-- EN-Revision: 45042fef652f1b4e904e809fcbfcf31f6c60670b Maintainer: daijie Status: ready -->
|
||
<!-- CREDITS: mowangjuanzi -->
|
||
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.ucfirst">
|
||
<refnamediv>
|
||
<refname>ucfirst</refname>
|
||
<refpurpose>将字符串的首字母转换为大写</refpurpose>
|
||
</refnamediv>
|
||
|
||
<refsect1 role="description">
|
||
&reftitle.description;
|
||
<methodsynopsis>
|
||
<type>string</type><methodname>ucfirst</methodname>
|
||
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
||
</methodsynopsis>
|
||
<para>
|
||
将 <parameter>string</parameter> 的首字符(如果首字符是 <literal>"a"</literal>(0x61)到
|
||
<literal>"z"</literal>(0x7a)范围内的 ASCII 字符)转换为大写字母,并返回这个字符串。
|
||
</para>
|
||
<para>
|
||
注意字母的定义取决于当前区域设定。例如,在默认的 “C” 区域,字符 umlaut-a(ä)将不会被转换。
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="parameters">
|
||
&reftitle.parameters;
|
||
<para>
|
||
<variablelist>
|
||
<varlistentry>
|
||
<term><parameter>string</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
输入字符串。
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="returnvalues">
|
||
&reftitle.returnvalues;
|
||
<para>
|
||
返回结果字符串。
|
||
</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>ucfirst</function> 示例</title>
|
||
<programlisting role="php">
|
||
<![CDATA[
|
||
<?php
|
||
$foo = 'hello world!';
|
||
echo ucfirst($foo), PHP_EOL; // Hello world!
|
||
|
||
$bar = 'HELLO WORLD!';
|
||
echo ucfirst($bar), PHP_EOL; // HELLO WORLD!
|
||
echo ucfirst(strtolower($bar)), PHP_EOL; // Hello world!
|
||
?>
|
||
]]>
|
||
</programlisting>
|
||
</example>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="seealso">
|
||
&reftitle.seealso;
|
||
<para>
|
||
<simplelist>
|
||
<member><function>lcfirst</function></member>
|
||
<member><function>strtolower</function></member>
|
||
<member><function>strtoupper</function></member>
|
||
<member><function>ucwords</function></member>
|
||
<member><function>mb_convert_case</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
|
||
-->
|