这篇文章主要介绍了详解php中mb_strpos的使用,通过使用语法以及实例给大家详细分析了用法,需要的朋友参考学习下。
(PHP 4 >= 4.0.6, PHP 5, PHP 7)mb_strpos — Find position of first occurrence of string in a stringmb_strpos — 查找字符串在另一个字符串中首次出现的位置
int mb_strpos ( string $haystack , string $needle [, int $offset = 0 [, string $encoding = mb_internal_encoding() ]] ) //Finds position of the first occurrence of a string in a string. // 查找 string 在一个 string 中首次出现的位置。 //Performs a multi-byte safe strpos() operation based on number of characters. The first character's position is 0, the second character position is 1, and so on. // 基于字符数执行一个多字节安全的 strpos() 操作。 第一个字符的位置是 0,第二个字符的位置是 1,以此类推。
haystack
The string being checked.
要被检查的 string。
立即学习“PHP免费学习笔记(深入)”;
needle
The string to find in haystack. In contrast with strpos(), numeric values are not applied as the ordinal value of a character.
在 haystack 中查找这个字符串。 和 strpos() 不同的是,数字的值不会被当做字符的顺序值。
offset
The search offset. If it is not specified, 0 is used. A negative offset counts from the end of the string.
jQuery图片内容展开/收缩选项卡,点击图片会出现对应的文字解说。兼容主流浏览器,php中文网推荐下载! 使用方法: 1、head区域引用以下文件
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号