Fix protos

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@222073 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jakub Vrana 2006-10-20 09:32:01 +00:00
parent cb09b6c255
commit 97abe09fe8
3 changed files with 31 additions and 19 deletions

View file

@ -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 @@ $args = array(
);
$myinputs = filter_input_array(INPUT_DATA, $args, $data);
$myinputs = filter_input_array(INPUT_POST, $args);
var_dump($myinputs);
echo "\n";
?>
]]>
</programlisting>
&example.outputs;

View file

@ -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 @@ $myinputs = input_var_array($data, $args);
var_dump($myinputs);
echo "\n";
?>
]]>
</programlisting>
&example.outputs;

View file

@ -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>