array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'function.quotemeta.php', 1 => 'quotemeta', ), 'up' => array ( 0 => 'ref.strings.php', 1 => 'Fonctions sur les chaînes de caractères', ), 'prev' => array ( 0 => 'function.quoted-printable-encode.php', 1 => 'quoted_printable_encode', ), 'next' => array ( 0 => 'function.rtrim.php', 1 => 'rtrim', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'fr', 'path' => 'reference/strings/functions/quotemeta.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
quotemeta — Protège les métacaractères
Retourne la chaîne str
après avoir introduit un antislash (\
)
devant tous les caractères suivants :
string
La chaîne d'entrée.
Retourne la chaîne dont les métacaractères ont été protégés ou
false
si une chaîne vide est fournie dans le paramètre
string
.
Exemple #1 Exemple avec quotemeta()
<?php
var_dump(quotemeta('PHP is a popular scripting language. Fast, flexible, and pragmatic.'));
?>
L'exemple ci-dessus va afficher :
string(69) "PHP is a popular scripting language\. Fast, flexible, and pragmatic\."
Note: Cette fonction gère les chaînes binaires.