mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 13:57:03 +08:00
140 lines
4.8 KiB
HTML
140 lines
4.8 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<title>大小写不敏感地查找字符串在另一个字符串中首次出现的位置</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.mb-stripos" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">mb_stripos</h1>
|
|
<p class="verinfo">(PHP 5 >= 5.2.0, PHP 7)</p><p class="refpurpose"><span class="refname">mb_stripos</span> — <span class="dc-title">大小写不敏感地查找字符串在另一个字符串中首次出现的位置</span></p>
|
|
|
|
</div>
|
|
<div class="refsect1 description" id="refsect1-function.mb-stripos-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>mb_stripos</strong></span>
|
|
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$haystack</code></span>
|
|
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$needle</code></span>
|
|
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$offset</code><span class="initializer"> = 0</span></span>
|
|
[, <span class="methodparam"><span class="type">string</span> <code class="parameter">$encoding</code><span class="initializer"> = mb_internal_encoding()</span></span>
|
|
]] ) : <span class="type">int</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
<span class="function"><strong>mb_stripos()</strong></span> 返回 <code class="parameter">needle</code> 在字符串 <code class="parameter">haystack</code> 中首次出现位置的数值。
|
|
和 <span class="function"><a href="mb_strpos.html" class="function">mb_strpos()</a></span> 不同的是,<span class="function"><strong>mb_stripos()</strong></span> 是大小写不敏感的。
|
|
如果 <code class="parameter">needle</code> 没找到,它将返回 <strong><code>FALSE</code></strong>。
|
|
</p>
|
|
</div>
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.mb-stripos-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">haystack</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
在这个字符串中查找获取 <code class="parameter">needle</code> 首次出现的位置
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">needle</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
在 <code class="parameter">haystack</code> 中查找这个字符串
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">offset</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
<code class="parameter">haystack</code> 里开始搜索的位置。如果是负数,就从字符串的尾部开始统计。
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">encoding</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
使用的字符编码名称。
|
|
如果省略了它,将使用内部字符编码。
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.mb-stripos-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
返回字符串 <code class="parameter">haystack</code> 中 <code class="parameter">needle</code> 首次出现位置的数值。
|
|
如果没有找到 <code class="parameter">needle</code>,它将返回 <strong><code>FALSE</code></strong>。
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 changelog" id="refsect1-function.mb-stripos-changelog">
|
|
<h3 class="title">更新日志</h3>
|
|
<table class="doctable informaltable">
|
|
|
|
<thead>
|
|
<tr>
|
|
<th>版本</th>
|
|
<th>说明</th>
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody class="tbody">
|
|
<tr>
|
|
<td>7.1.0</td>
|
|
<td>
|
|
支持 <code class="parameter">offset</code> 使用负数。
|
|
</td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.mb-stripos-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="stripos.html" class="function" rel="rdfs-seeAlso">stripos()</a> - 查找字符串首次出现的位置(不区分大小写)</span></li>
|
|
<li class="member"><span class="function"><a href="strpos.html" class="function" rel="rdfs-seeAlso">strpos()</a> - 查找字符串首次出现的位置</span></li>
|
|
<li class="member"><span class="function"><a href="mb_strpos.html" class="function" rel="rdfs-seeAlso">mb_strpos()</a> - 查找字符串在另一个字符串中首次出现的位置</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
</div></div></div></body></html> |