Added description of addcslashes() and stripcslashes().

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@12652 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jakub Skopal 1999-09-06 00:24:06 +00:00
parent 1f579a5b2b
commit 486a664fad

View file

@ -9,6 +9,43 @@
handling sections.
</partintro>
<refentry id="function.addcslashes">
<refnamediv>
<refname>AddCSlashes</refname>
<refpurpose>quote string with slashes in a C style</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>string <function>addcslashes</function></funcdef>
<paramdef>string <parameter>str</parameter></paramdef>
<paramdef>string <parameter>charlist</parameter></paramdef>
</funcsynopsis>
<para>
Returns a string with backslashes before characters that are listed
in <parameter>charlist</parameter> parameter. It escapes
<literal>\n</literal>, <literal>\r</literal> etc. in C-like style,
characters with ASCII code lower than 32 and higher than 126 are
converted to octal representation. Be carefull when escaping alphanumeric
characters. You can specify a range in <parameter>charlist</parameter>
like "\0..\37", which would escape all characters with ASCII code
between 0 and 31.
<example>
<title>addcslashes() example</title>
<programlisting>
$escaped = addcslashes($not_escaped, "\0..\37!@\177..\377");
</programlisting></example>
<simpara>
Added in PHP4b3-dev.
<para>
See also <function>stripcslashes</function>, <function>stripslashes</function>, <function>htmlspecialchars</function>
<function>htmlspecialchars</function> and <function>quotemeta</function>.
</refsect1>
</refentry>
<refentry id="function.addslashes">
<refnamediv>
<refname>AddSlashes</refname>
@ -1162,6 +1199,31 @@ $formatted = sprintf ("%01.2f", $money);
</refsect1>
</refentry>
<refentry id="function.stripcslashes">
<refnamediv>
<refname>StripCSlashes</refname>
<refpurpose>un-quote string quoted with addcslashes</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>string <function>stripcslashes</function></funcdef>
<paramdef>string <parameter>str</parameter></paramdef>
</funcsynopsis>
<para>
Returns a string with backslashes stripped off. Recognizes
C-like <literal>\n</literal>, <literal>\r</literal> ..., octal
and hexadecimal representation.
<simpara>
Added in PHP4b3-dev.
<simpara>
See also <function>addcslashes</function>.
</refsect1>
</refentry>
<refentry id="function.stripslashes">
<refnamediv>
<refname>StripSlashes</refname>