array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'function.quotemeta.php', 1 => 'quotemeta', ), 'up' => array ( 0 => 'ref.strings.php', 1 => 'String Functions', ), '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' => 'en', '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 — Quote meta characters
Returns a version of str with a backslash character (\
)
before every character that is among these:
string
The input string.
Returns the string with meta characters quoted, or false
if an empty
string is given as string
.
Example #1 quotemeta() example
<?php
var_dump(quotemeta('PHP is a popular scripting language. Fast, flexible, and pragmatic.'));
?>
The above example will output:
string(69) "PHP is a popular scripting language\. Fast, flexible, and pragmatic\."
Note: This function is binary-safe.