php-doc-en/reference/intl/dateformatter/parse.xml

141 lines
3.8 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="dateformatter.parse" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::parse</refname>
<refname>datefmt_parse</refname>
<refpurpose>converts string $value to an incremental time value, starting at</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<para>Object oriented style</para>
<classsynopsis>
<ooclass><classname>DateFormatter</classname></ooclass>
<methodsynopsis>
<type>integer</type><methodname>parse</methodname>
<methodparam><type>string</type><parameter>value</parameter></methodparam>
<methodparam><type>integer</type><parameter>parse_pos</parameter></methodparam>
<methodparam><type>integer</type><parameter>error</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<para>Procedural style</para>
<methodsynopsis>
<type>integer</type><methodname>datefmt_parse</methodname>
<methodparam><type>DateFormatter</type><parameter>fmt</parameter></methodparam>
<methodparam><type>string</type><parameter>value</parameter></methodparam>
<methodparam><type>integer</type><parameter>parse_pos</parameter></methodparam>
<methodparam><type>integer</type><parameter>error</parameter></methodparam>
</methodsynopsis>
<para>
converts string $value to an incremental time value, starting at
$parse_pos and consuming as much of the input value as possible
If no error occurs before $value is consumed, $parse_pos will contain -1
otherwise it will contain the position at which parsing ended (and the error
occurred). $error will contain the error code. Note that this function
does not change the value in get_error().
This variable will contain the end position if the parse fails
If $parse_pos > strlen($value), the parse fails immediately. </para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>fmt</parameter></term>
<listitem>
<para>
The formatter resource </para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
string to convert to a time </para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>parse_pos</parameter></term>
<listitem>
<para>
position at which to start the parsing in $value (zero-based) </para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>error</parameter></term>
<listitem>
<para>
error value of any error that occurs during parsing </para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
timestamp parsed value </para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>datefmt_parse</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
?>
]]>
</programlisting>
</example>
<example>
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
?>
]]>
</programlisting>
</example>
&example.outputs;
<screen>
<![CDATA[
TODO
]]>
</screen>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
</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
-->