strpos() - 查找字符串首次出现的位置

strrpos() 函数查找字符串在另一字符串中最后一次出现的位置(区分大小写)。

strripos() 函数查找字符串在另一字符串中最后一次出现的位置(不区分大小写)。

strstr() - 函数搜索字符串在另一字符串中的第一次出现,区分大小写。

http://www.runoob.com/php/func-string-strstr.html

strpbrk(a,b)-字符串a中查找b的字符

<?php

$text = 'This is a Simple text.';

// 输出 "is is a Simple text.",因为 'i' 先被匹配
echo strpbrk($text, 'mi');

// 输出 "Simple text.",因为字符区分大小写
echo strpbrk($text, 'S');
?>

 strncasecmp() 函数比较两个字符串(不区分大小写)。

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
猜你喜欢
  • 2021-07-26
  • 2021-07-26
  • 2021-08-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案