array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.quotemeta.php', 1 => 'quotemeta', ), 'up' => array ( 0 => 'ref.strings.php', 1 => '字符串 函数', ), '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' => 'zh', '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 — 转义元字符集
string
输入字符串
返回 元字符集被转义后的 字符串,如果输入字符串string
为空,
则返回 false
。
示例 #1 quotemeta() 示例
<?php
var_dump(quotemeta('PHP is a popular scripting language. Fast, flexible, and pragmatic.'));
?>
以上示例会输出:
string(69) "PHP is a popular scripting language\. Fast, flexible, and pragmatic\."
注意: 此函数可安全用于二进制对象。