cvs: /phpdoc/functions strings.sgml

From: Date: Mon, 06 Sep 1999 00:24:06 +0000
Subject: cvs: /phpdoc/functions strings.sgml
Groups: php.dev 
Request: Send a blank email to php-dev+get-10590@lists.php.net to get a copy of this message
riffraff Sun Sep 5 20:24:06 1999 EDT Modified files: /phpdoc/functions strings.sgml Log: Added description of addcslashes() and stripcslashes(). Index: phpdoc/functions/strings.sgml diff -u phpdoc/functions/strings.sgml:1.10 phpdoc/functions/strings.sgml:1.11 --- phpdoc/functions/strings.sgml:1.10 Sun Sep 5 19:11:23 1999 +++ phpdoc/functions/strings.sgml Sun Sep 5 20:24:06 1999 @@ -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> @@ -1159,6 +1196,31 @@ string. It errors on the side of caution in case of incomplete or bogus tags. It uses the same tag stripping state machine as the <function>fgetss</function> function. + </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>

« previous php.dev (#10590) next »