详解PHP中mb_strpos的使用php技巧

jacklove
发布: 2018-06-28 17:27:08
原创
2467人浏览过

这篇文章主要介绍了详解php中mb_strpos的使用,通过使用语法以及实例给大家详细分析了用法,需要的朋友参考学习下。

mb_strpos

(PHP 4 >= 4.0.6, PHP 5, PHP 7)mb_strpos — Find position of first occurrence of string in a stringmb_strpos — 查找字符串在另一个字符串中首次出现的位置

Description

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,以此类推。
登录后复制

Parameters

haystack

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图片内容展开-收缩选项卡
    jQuery图片内容展开-收缩选项卡

    jQuery图片内容展开/收缩选项卡,点击图片会出现对应的文字解说。兼容主流浏览器,php中文网推荐下载! 使用方法: 1、head区域引用以下文件

开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号