Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update example #790

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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