cvs: phpdoc /en/reference/filter/functions filter-input-array.xml filter-var-array.xml filter-var.xml

From: Date: Fri, 20 Oct 2006 09:32:02 +0000
Subject: cvs: phpdoc /en/reference/filter/functions filter-input-array.xml filter-var-array.xml filter-var.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969374248@lists.php.net to get a copy of this message
vrana Fri Oct 20 09:32:02 2006 UTC Modified files: /phpdoc/en/reference/filter/functions filter-input-array.xml filter-var-array.xml filter-var.xml Log: Fix protos http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/filter/functions/filter-input-array.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/filter/functions/filter-input-array.xml diff -u phpdoc/en/reference/filter/functions/filter-input-array.xml:1.1 phpdoc/en/reference/filter/functions/filter-input-array.xml:1.2 --- phpdoc/en/reference/filter/functions/filter-input-array.xml:1.1 Fri Oct 20 01:47:29 2006 +++ phpdoc/en/reference/filter/functions/filter-input-array.xml Fri Oct 20 09:32:01 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.filter-input-array"> <refnamediv> <refname>filter_input_array</refname> @@ -10,7 +10,7 @@ <methodsynopsis> <type>mixed</type><methodname>filter_input_array</methodname> <methodparam><type>int</type><parameter>type</parameter></methodparam> - <methodparam><type>array</type><parameter>options</parameter></methodparam> + <methodparam choice="opt"><type>mixed</type><parameter>definition</parameter></methodparam> </methodsynopsis> &warn.experimental.func; <para> @@ -29,7 +29,7 @@ One of <constant>INPUT_GET</constant>, <constant>INPUT_POST</constant>, <constant>INPUT_COOKIE</constant>, <constant>INPUT_SERVER</constant>, <constant>INPUT_ENV</constant>, <constant>INPUT_SESSION</constant>, or - <constant>INPUT_DATA</constant>. + <constant>INPUT_REQUEST</constant>. </para> </listitem> </varlistentry> @@ -47,6 +47,11 @@ that apply to the filter. See the example below for a better understanding. </para> + <para> + This parameter can be also an integer holding a <link + linkend="filter.intro">filter constant</link>. Then all values in the + input array is filtered by this filter. + </para> </listitem> </varlistentry> </variablelist> @@ -72,13 +77,15 @@ <![CDATA[ <?php error_reporting(E_ALL | E_STRICT); -$data = array( +/* data actually came from POST +$_POST = array( 'product_id' => 'libgd<script>', 'component' => '10', 'versions' => '2.0.33', 'testscalar' => array('2', '23', '10', '12'), 'testarray' => '2', ); +*/ $args = array( 'product_id' => FILTER_SANITIZE_ENCODED, @@ -99,10 +106,11 @@ ); -$myinputs = filter_input_array(INPUT_DATA, $args, $data); +$myinputs = filter_input_array(INPUT_POST, $args); var_dump($myinputs); echo "\n"; +?> ]]> </programlisting> &example.outputs; http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/filter/functions/filter-var-array.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/filter/functions/filter-var-array.xml diff -u phpdoc/en/reference/filter/functions/filter-var-array.xml:1.1 phpdoc/en/reference/filter/functions/filter-var-array.xml:1.2 --- phpdoc/en/reference/filter/functions/filter-var-array.xml:1.1 Fri Oct 20 01:47:29 2006 +++ phpdoc/en/reference/filter/functions/filter-var-array.xml Fri Oct 20 09:32:01 2006 @@ -1,16 +1,16 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.filter-var-array"> <refnamediv> <refname>filter_var_array</refname> - <refpurpose>Gets multiple variables from outside PHP and optionally filters them</refpurpose> + <refpurpose>Gets multiple variables and optionally filters them</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>mixed</type><methodname>filter_var_array</methodname> - <methodparam><type>int</type><parameter>type</parameter></methodparam> - <methodparam><type>array</type><parameter>options</parameter></methodparam> + <methodparam><type>array</type><parameter>data</parameter></methodparam> + <methodparam choice="opt"><type>mixed</type><parameter>definition</parameter></methodparam> </methodsynopsis> &warn.experimental.func; <para> @@ -23,13 +23,10 @@ <para> <variablelist> <varlistentry> - <term><parameter>type</parameter></term> + <term><parameter>data</parameter></term> <listitem> <para> - One of <constant>INPUT_GET</constant>, <constant>INPUT_POST</constant>, - <constant>INPUT_COOKIE</constant>, <constant>INPUT_SERVER</constant>, - <constant>INPUT_ENV</constant>, <constant>INPUT_SESSION</constant>, or - <constant>INPUT_DATA</constant>. + An array with string keys containing the data to filter. </para> </listitem> </varlistentry> @@ -47,6 +44,11 @@ that apply to the filter. See the example below for a better understanding. </para> + <para> + This parameter can be also an integer holding a <link + linkend="filter.intro">filter constant</link>. Then all values in the + input array is filtered by this filter. + </para> </listitem> </varlistentry> </variablelist> @@ -101,6 +103,7 @@ var_dump($myinputs); echo "\n"; +?> ]]> </programlisting> &example.outputs; http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/filter/functions/filter-var.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/filter/functions/filter-var.xml diff -u phpdoc/en/reference/filter/functions/filter-var.xml:1.1 phpdoc/en/reference/filter/functions/filter-var.xml:1.2 --- phpdoc/en/reference/filter/functions/filter-var.xml:1.1 Fri Oct 20 01:47:29 2006 +++ phpdoc/en/reference/filter/functions/filter-var.xml Fri Oct 20 09:32:01 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- Generated by xml_proto.php v2.4. Found in /scripts directory of phpdoc. --> <refentry id="function.filter-var"> <refnamediv> @@ -9,9 +9,9 @@ <refsect1 role="description"> &reftitle.description; <methodsynopsis> - <type>mixed</type><methodname>filter_data</methodname> + <type>mixed</type><methodname>filter_var</methodname> <methodparam><type>mixed</type><parameter>variable</parameter></methodparam> - <methodparam><type>int</type><parameter>filter</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>filter</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>options</parameter></methodparam> </methodsynopsis> @@ -35,6 +35,7 @@ <listitem> <para> ID of a filter to use. + Defaults to <constant>FILTER_SANITIZE_STRING</constant>. </para> </listitem> </varlistentry> @@ -66,8 +67,8 @@ <programlisting role="php"> <![CDATA[ <?php -var_dump(filter_data('bob@example.com', FILTER_VALIDATE_EMAIL)); -var_dump(filter_data('example.com', FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED)); +var_dump(filter_var('bob@example.com', FILTER_VALIDATE_EMAIL)); +var_dump(filter_var('example.com', FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED)); ?> ]]> </programlisting>

« previous php.doc (#969374248) next »