svn: /phpdoc/en/trunk/reference/datetime/datetime/ createfromformat.xml
| From: | Christoph Michael Becker | Date: | Tue, 14 Jun 2016 11:59:53 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/datetime/datetime/ createfromformat.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-14183@lists.php.net to get a copy of this message | ||
cmb Tue, 14 Jun 2016 11:59:53 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=339343
Log:
Fix #64588: Missing Documentation of Escape Sequence
Bug: https://bugs.php.net/64588 (Open) Missing
Documentation of Escape Sequence
Changed paths:
U phpdoc/en/trunk/reference/datetime/datetime/createfromformat.xml
Modified: phpdoc/en/trunk/reference/datetime/datetime/createfromformat.xml
===================================================================
--- phpdoc/en/trunk/reference/datetime/datetime/createfromformat.xml 2016-06-13 15:09:58 UTC (rev
339342)
+++ phpdoc/en/trunk/reference/datetime/datetime/createfromformat.xml 2016-06-14 11:59:53 UTC (rev
339343)
@@ -281,6 +281,10 @@
<methodname>DateTime::getLastErrors</methodname>.
</para>
<para>
+ To include literal characters in <parameter>format</parameter>, you have
+ to escape them with a backslash (<literal>\</literal>).
+ </para>
+ <para>
If <parameter>format</parameter> does not contain the character
<literal>!</literal> then portions of the generated time which are not
specified in <parameter>format</parameter> will be set to the current
@@ -429,6 +433,22 @@
]]>
</screen>
</example>
+ <example>
+ <title>Format string with literal characters</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+echo DateTime::createFromFormat('H\h i\m s\s','23h 15m
03s')->format('H:i:s');
+?>
+]]>
+ </programlisting>
+ &example.outputs.similar;
+ <screen>
+<![CDATA[
+23:15:03
+]]>
+ </screen>
+ </example>
</refsect1>
<refsect1 role="seealso">