mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-21 03:18:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@185012 c90b9560-bf6c-de11-be94-00142212c4b1
86 lines
2.2 KiB
XML
86 lines
2.2 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.7 $ -->
|
|
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
|
|
<refentry id="function.checkdate">
|
|
<refnamediv>
|
|
<refname>checkdate</refname>
|
|
<refpurpose>Validate a Gregorian date</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>checkdate</methodname>
|
|
<methodparam><type>int</type><parameter>month</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>day</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>year</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns &true; if the date given is valid; otherwise returns &false;.
|
|
Checks the validity of the date formed by the arguments. A date
|
|
is considered valid if:
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
year is between 1 and 32767 inclusive
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
month is between 1 and 12 inclusive
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<parameter>Day</parameter> is within the allowed number of
|
|
days for the given <parameter>month</parameter>. Leap
|
|
<parameter>year</parameter>s are taken into consideration.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>checkdate</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
var_dump(checkdate(12, 31, 2000));
|
|
var_dump(checkdate(2, 29, 2001));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
bool(true)
|
|
bool(false)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also <function>mktime</function> and <function>strtotime</function>.
|
|
</para>
|
|
</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
|
|
indent-tabs-mode:nil
|
|
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
|
|
-->
|