1
0
mirror of https://github.com/php/doc-ru.git synced 2026-03-26 00:32:15 +01:00
Files
archived-doc-ru/reference/strings/functions/ucwords.xml
Mikhail Alferov 9d4850de10 Обновление перевода (#608)
Co-authored-by: Sergey Panteleev <sergey@php.net>
2023-12-26 09:26:16 +03:00

170 lines
4.9 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 54ff7bf8e0f8fa90988cccf6b583517366605f6d Maintainer: shein Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.ucwords" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ucwords</refname>
<refpurpose>Преобразовывает в верхний регистр первый символ каждого слова в строке</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>ucwords</methodname>
<methodparam><type>string</type><parameter>string</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>separators</parameter><initializer>" \t\r\n\f\v"</initializer></methodparam>
</methodsynopsis>
<para>
Возвращает строку <parameter>string</parameter>, в которой первый
символ каждого слова переведён в верхний регистр, если этот символ
является символом ASCII между <literal>"a"</literal> (0x61) и <literal>"z"</literal> (0x7a).
</para>
<para>
Для этой функции слово - это строка символов, не перечисленных в <parameter>separators</parameter>.
По умолчанию это: пробел, горизонтальная табуляция, возврат каретки, перевод строки, разрыв страницы и вертикальная табуляция.
</para>
<para>
Чтобы сделать аналогичное преобразование многобайтовых строк,
используйте функцию <function>mb_convert_case</function> с режимом <constant>MB_CASE_TITLE</constant>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>string</parameter></term>
<listitem>
<para>
Входная строка.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>separators</parameter></term>
<listitem>
<para>
Необязательный параметр <parameter>separators</parameter> содержит символы разделителей слов.
</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>ucwords</function></title>
<programlisting role="php">
<![CDATA[
<?php
$foo = 'hello world!';
$foo = ucwords($foo); // Hello World!
$bar = 'HELLO WORLD!';
$bar = ucwords($bar); // HELLO WORLD!
$bar = ucwords(strtolower($bar)); // Hello World!
?>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>Пример <function>ucwords</function> с заданным разделителем</title>
<programlisting role="php">
<![CDATA[
<?php
$foo = 'hello|world!';
$bar = ucwords($foo); // Hello|world!
$baz = ucwords($foo, "|"); // Hello|World!
?>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>Пример использования <function>ucwords</function> с дополнительными разделителями</title>
<programlisting role="php">
<![CDATA[
<?php
$foo = "mike o'hara";
$bar = ucwords($foo); // Mike O'hara
$baz = ucwords($foo, " \t\r\n\f\v'"); // Mike O'Hara
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&note.bin-safe;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>strtoupper</function></member>
<member><function>strtolower</function></member>
<member><function>ucfirst</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
-->