svn: /phpdoc/en/trunk/reference/info/functions/ getopt.xml
| From: | Philip Olson | Date: | Wed, 23 Jul 2014 03:45:40 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/info/functions/ getopt.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-12636@lists.php.net to get a copy of this message | ||
philip Wed, 23 Jul 2014 03:45:40 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=334361
Log:
Moved command executions to their own programlisting, for improved readability. And added/moved
titles around.
Changed paths:
U phpdoc/en/trunk/reference/info/functions/getopt.xml
Modified: phpdoc/en/trunk/reference/info/functions/getopt.xml
===================================================================
--- phpdoc/en/trunk/reference/info/functions/getopt.xml 2014-07-22 19:19:50 UTC (rev 334360)
+++ phpdoc/en/trunk/reference/info/functions/getopt.xml 2014-07-23 03:45:40 UTC (rev 334361)
@@ -142,19 +142,22 @@
&reftitle.examples;
<para>
<example xml:id="getopt.examples-1">
- <title><function>getopt</function> example</title>
+ <title><function>getopt</function> example: The basics</title>
<programlisting role="php">
<![CDATA[
<?php
+// Script example.php
$options = getopt("f:hp:");
var_dump($options);
?>
]]>
</programlisting>
- <para>
- Running the above script with <literal>php script.php -fvalue -h</literal>
- will output:
- </para>
+ <programlisting role="shell">
+<![CDATA[
+shell> php example.php -fvalue -h
+]]>
+ </programlisting>
+ &example.outputs;
<screen>
<![CDATA[
array(2) {
@@ -169,10 +172,11 @@
</para>
<para>
<example xml:id="getopt.examples-2">
- <title><function>getopt</function> example#2</title>
+ <title><function>getopt</function> example: Introducing long
options</title>
<programlisting role="php">
<![CDATA[
<?php
+// Script example.php
$shortopts = "";
$shortopts .= "f:"; // Required value
$shortopts .= "v::"; // Optional value
@@ -189,11 +193,12 @@
?>
]]>
</programlisting>
- <para>
- Running the above script with <literal>php script.php -f "value for f" -v
- -a --required value --optional="optional value" --option</literal>
- will output:
- </para>
+ <programlisting role="shell">
+<![CDATA[
+shell> php example.php -f "value for f" -v -a --required value
--optional="optional value" --option
+]]>
+ </programlisting>
+ &example.outputs;
<screen>
<![CDATA[
array(6) {
@@ -216,20 +221,22 @@
</para>
<para>
<example xml:id="getopt.examples-3">
- <title><function>getopt</function> example#3</title>
- <para>Passing multiple options as one</para>
+ <title><function>getopt</function> example: Passing multiple options as
one</title>
<programlisting role="php">
<![CDATA[
<?php
+// Script example.php
$options = getopt("abc");
var_dump($options);
?>
]]>
</programlisting>
- <para>
- Running the above script with <literal>php script.php -aaac</literal>
- will output:
- </para>
+ <programlisting role="shell">
+<![CDATA[
+shell> php example.php -aaac
+]]>
+ </programlisting>
+ &example.outputs;
<screen>
<![CDATA[
array(2) {