(PHP 5, PHP 7, PHP 8)
strpbrk — 在字符串中查找一組字符的任何一個字符
$haystack, string $char_list): string
strpbrk() 函數(shù)在 haystack 字符串中查找 char_list 中的字符。
haystack
在此字符串中查找 char_list。
char_list該參數(shù)區(qū)分大小寫。
返回一個以找到的字符開始的子字符串。如果沒有找到,則返回 false。
示例 #1 strpbrk() 范例
<?php
$text = 'This is a Simple text.';
// 輸出 "is is a Simple text.",因為 'i' 先被匹配
echo strpbrk($text, 'mi');
// 輸出 "Simple text.",因為字符區(qū)分大小寫
echo strpbrk($text, 'S');
?>