array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'function.strpbrk.php', 1 => 'strpbrk', ), 'up' => array ( 0 => 'ref.strings.php', 1 => 'Fonctions sur les chaînes de caractères', ), 'prev' => array ( 0 => 'function.strncmp.php', 1 => 'strncmp', ), 'next' => array ( 0 => 'function.strpos.php', 1 => 'strpos', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'fr', 'path' => 'reference/strings/functions/strpbrk.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5, PHP 7, PHP 8)
strpbrk — Recherche un ensemble de caractères dans une chaîne de caractères
strpbrk() recherche l'ensemble de caractères
characters
dans la chaîne string
.
string
La chaîne dans laquelle on cherche characters
.
characters
Ce paramètre est sensible à la casse.
Retourne une chaîne, commençant au premier caractère trouvé,
ou false
s'il n'a pas été trouvé.
Exemple #1 Exemple avec strpbrk()
<?php
$text = 'This is a Simple text.';
// Ceci affichera "is is a Simple text." car 'i' correspond au premier
echo strpbrk($text, 'mi');
// Ceci affichera "Simple text." car les caractères sont sensibles à la casse
echo strpbrk($text, 'S');
?>