cvs: peardoc /en/package/validate validate.xml /en/package/validate/validate email.xml intro.xml

From: Date: Sat, 23 Aug 2008 18:15:08 +0000
Subject: cvs: peardoc /en/package/validate validate.xml /en/package/validate/validate email.xml intro.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-11056@lists.php.net to get a copy of this message
amir Sat Aug 23 18:15:08 2008 UTC Added files: /peardoc/en/package/validate/validate email.xml intro.xml Modified files: /peardoc/en/package/validate validate.xml Log: Validate Docs. Intro and Email for now http://cvs.php.net/viewvc.cgi/peardoc/en/package/validate/validate.xml?r1=1.4&r2=1.5&diff_format=u Index: peardoc/en/package/validate/validate.xml diff -u peardoc/en/package/validate/validate.xml:1.4 peardoc/en/package/validate/validate.xml:1.5 --- peardoc/en/package/validate/validate.xml:1.4 Sun Oct 28 07:32:52 2007 +++ peardoc/en/package/validate/validate.xml Sat Aug 23 18:15:07 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.4 $ --> -<!-- $Id: validate.xml,v 1.4 2007/10/28 07:32:52 moosh Exp $ --> +<!-- $Revision: 1.5 $ --> +<!-- $Id: validate.xml,v 1.5 2008/08/23 18:15:07 amir Exp $ --> <!-- CREDITS: msaraujo moosh --> <sect1 id="package.validate.validate"> @@ -51,6 +51,8 @@ </listitem> </itemizedlist> </para> + &package.validate.validate.intro; + &package.validate.validate.email; </sect1> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/peardoc/en/package/validate/validate/email.xml?view=markup&rev=1.1 Index: peardoc/en/package/validate/validate/email.xml +++ peardoc/en/package/validate/validate/email.xml <!-- $Revision: 1.1 $ --> <refentry id="package.validate.validate.email"> <refnamediv> <refname>Email address validation</refname> <refpurpose> Validation for email addresses. </refpurpose> </refnamediv> <refsect1 id="package.validate.validate.email.intro"> <title>Introduction to Email Address validation</title> <titleabbrev>Introduction</titleabbrev> <para> This method validate email addresses against both the general format and the one described in <ulink url="&url.rfc;822">RFC 822</ulink>. </para> <para> This method takes two arguments: <itemizedlist> <listitem> <simpara> An email address. </simpara> </listitem> <listitem> <simpara> An array of options (optional). </simpara> </listitem> </itemizedlist> </para> <para> Various option are: <itemizedlist> <listitem> <simpara> check_domain (boolean) - Check or not if the domain exists. </simpara> </listitem> <listitem> <simpara> use_rfc822 (boolean) - Apply the full RFC822 grammar. </simpara> </listitem> <listitem> <simpara> fullTLDValidation (boolean) - All top-level domains. </simpara> </listitem> <listitem> <simpara> VALIDATE_GTLD_EMAILS (boolean) - Only generic top-level domains. </simpara> </listitem> <listitem> <simpara> VALIDATE_CCTLD_EMAILS (boolean) - Only country code top-level domains. </simpara> </listitem> <listitem> <simpara> VALIDATE_ITLD_EMAILS (boolean) - Only international top-level domains. </simpara> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.validate.validate.email.usage"> <title>How to use Email Validation</title> <example> <title>Email Validation</title> <para> The following example assumes that one wants to use RFC822 strict mode to validate email addresses. </para> <programlisting role="php"> require_once 'Validate.php'; $email = '"Doe, John" &lt;johndoe@example.net&gt;'; if (Validate::email($email, array('use_rfc822' => true))) { echo 'Valid!'; } else { echo $email . ' failed.'; } </programlisting> <para> And the following one assumes that one wants to check if the domain exists. </para> <programlisting role="php"> require_once 'Validate.php'; $email = 'info@example.com'; if (Validate::email($email, array('check_domain' => 'true'))) { echo $email . ' is valid and domain exists'; } </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/package/validate/validate/intro.xml?view=markup&rev=1.1 Index: peardoc/en/package/validate/validate/intro.xml +++ peardoc/en/package/validate/validate/intro.xml <!-- $Revision: 1.1 $ --> <refentry id="package.validate.validate.intro"> <refnamediv> <refname>Introduction</refname> <refpurpose> Introduction to <classname>Validate</classname> </refpurpose> </refnamediv> <refsect1 id="package.validate.validate.intro.overview"> <title>Overview</title> <para> With this package, one can easily validate various data. It includes numbers, email, string, date, URI and posibility valid multiple data with a single method call. </para> <para> Some of above mentioned features have corresponding RFCs, in case, <classname>Validate</classname> conforms to those RFCs. For example email validation mostly covers <ulink url="&url.rfc;822">RFC 822</ulink> or URI conforms to <ulink url="&url.rfc;2396">RFC 2396</ulink>. </para> </refsect1> <refsect1 id="package.validate.validate.intro.examples"> <title>A few examples</title> <example> <title> Validating an email address </title> <programlisting role="php"> require_once 'Validate.php'; if (!Validate::email('johndoe@example.net')) { echo 'Invalid Email address'; } else { echo 'Its Valid!'; } </programlisting> </example> <example> <title>Validating dates</title> <para> In this example, date would first checked against desired format, and then get checked to see if it's not before "15 February 1986" or after "23 August 2008". </para> <programlisting role="php"> require_once 'Validate.php'; var_dump(Validate::date('121202', array( 'format' => '%d%m%y', 'min' => array('15', '02', '1986'), 'max' => array('23', '08', '2008')))); </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->

« previous php.pear.doc (#11056) next »