Skip to content

Commit

Permalink
update example (#790)
Browse files Browse the repository at this point in the history
  • Loading branch information
big-dream authored Sep 19, 2023
1 parent d5f7c56 commit b57d2a6
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions reference/info/functions/getopt.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 4d02fe98ddc684a0d82a3921ef189a71b98f4f04 Maintainer: daijie Status: ready -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.getopt">
<refentry xml:id="function.getopt" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>getopt</refname>
<refpurpose>从命令行参数列表中获取选项</refpurpose>
Expand Down Expand Up @@ -139,10 +139,9 @@
<![CDATA[
<?php
// Script example.php
$rest_index = null;
$opts = getopt('a:b:', [], $rest_index);
$pos_args = array_slice($argv, $rest_index);
var_dump($pos_args);
$options = getopt("f:hp:");
var_dump($options);
?>
]]>
</programlisting>
<programlisting role="shell">
Expand Down Expand Up @@ -256,9 +255,9 @@ array(2) {
<![CDATA[
<?php
// Script example.php
$optind = null;
$opts = getopt('a:b:', [], $optind);
$pos_args = array_slice($argv, $optind);
$rest_index = null;
$opts = getopt('a:b:', [], $rest_index);
$pos_args = array_slice($argv, $rest_index);
var_dump($pos_args);
]]>
</programlisting>
Expand Down

0 comments on commit b57d2a6

Please sign in to comment.