PHP 8.5.0 Released!

Voting

: nine plus zero?
(Example: nine)

The Note You're Voting On

koenbollen at gnospamail dot com
18 years ago
After you use the getopt function you can use the following script to update the $argv array:
<?php
  $options = "c:ho:s:t:uvV";
  $opts = getopt( $options );
  foreach( $opts as $o => $a )
  {
    while( $k = array_search( "-" . $o, $argv ) )
    {
      if( $k )
        unset( $argv[$k] );
      if( preg_match( "/^.*".$o.":.*$/i", $options ) )
        unset( $argv[$k+1] );
    }
  }
  $argv = array_merge( $argv );
?>
Note: I used the array_merge function to reindex the array's keys.

Cheers, Koen Bollen

<< Back to user notes page

To Top