mirror of
https://github.com/php/doc-ru.git
synced 2026-04-24 07:48:05 +02:00
401b3612ee
Co-authored-by: Sergey Panteleev <sergey@php.net>
139 lines
4.6 KiB
XML
139 lines
4.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- EN-Revision: f63aa0afcde35bf8450e32128295d6e08cd6b120 Maintainer: tmn Status: ready -->
|
||
<!-- Reviewed: no -->
|
||
<refentry xml:id="function.mb-strpos" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||
<refnamediv>
|
||
<refname>mb_strpos</refname>
|
||
<refpurpose>
|
||
Ищет позицию первого вхождения подстроки в строку
|
||
</refpurpose>
|
||
</refnamediv>
|
||
|
||
<refsect1 role="description">
|
||
&reftitle.description;
|
||
<methodsynopsis>
|
||
<type class="union"><type>int</type><type>false</type></type><methodname>mb_strpos</methodname>
|
||
<methodparam><type>string</type><parameter>haystack</parameter></methodparam>
|
||
<methodparam><type>string</type><parameter>needle</parameter></methodparam>
|
||
<methodparam choice="opt"><type>int</type><parameter>offset</parameter><initializer>0</initializer></methodparam>
|
||
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam>
|
||
</methodsynopsis>
|
||
<para>
|
||
Находит позицию первого вхождения подстроки (<type>string</type>)
|
||
в строку (<type>string</type>).
|
||
</para>
|
||
<para>
|
||
Выполняет безопасную многобайтовую операцию
|
||
<function>strpos</function>, которая опирается на число символов в строке.
|
||
Первый символ стоит на позиции 0, позиция второго 1 и так далее.
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="parameters">
|
||
&reftitle.parameters;
|
||
<para>
|
||
<variablelist>
|
||
<varlistentry>
|
||
<term><parameter>haystack</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
Строка (<type>string</type>), в которой функция будет искать подстроку.
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><parameter>needle</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
Подстрока, которую нужно найти в строке
|
||
<parameter>haystack</parameter>. По сравнению
|
||
с функцией <function>strpos</function>, эта функция не использует числовые значения
|
||
в качестве порядковых значений символов.
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><parameter>offset</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
Смещение начала поиска. Если не задан, принимает значение 0. Отрицательное смещение
|
||
отсчитывается от конца строки.
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><parameter>encoding</parameter></term>
|
||
<listitem>
|
||
&mbstring.encoding.parameter;
|
||
</listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="returnvalues">
|
||
&reftitle.returnvalues;
|
||
<para>
|
||
Возвращает число — позицию первого вхождения подстроки
|
||
<parameter>needle</parameter> в строку (<type>string</type>) <parameter>haystack</parameter>.
|
||
Если подстрока <parameter>needle</parameter> не найдена,
|
||
возвращает &false;.
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="changelog">
|
||
&reftitle.changelog;
|
||
<informaltable>
|
||
<tgroup cols="2">
|
||
<thead>
|
||
<row>
|
||
<entry>&Version;</entry>
|
||
<entry>&Description;</entry>
|
||
</row>
|
||
</thead>
|
||
<tbody>
|
||
&mbstring.changelog.needle-empty;
|
||
&mbstring.changelog.encoding-nullable;
|
||
<row>
|
||
<entry>7.1.0</entry>
|
||
<entry>
|
||
В параметре <parameter>offset</parameter> добавлена поддержка отрицательных значений.
|
||
</entry>
|
||
</row>
|
||
</tbody>
|
||
</tgroup>
|
||
</informaltable>
|
||
</refsect1>
|
||
|
||
<refsect1 role="seealso">
|
||
&reftitle.seealso;
|
||
<para>
|
||
<simplelist>
|
||
<member><function>mb_internal_encoding</function></member>
|
||
<member><function>strpos</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
|
||
-->
|