Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8602673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:08:32+00:00 2026-06-12T02:08:32+00:00

I am not sure if this is possible, but I need to make a

  • 0

I am not sure if this is possible, but I need to make a dirty hack.
Assume I am invoking php from cli

php script.php one two

then in script.php I am doing something with two parameter, and then I would like to remove it, so the third party code that is included later on thought, that the initial command was

php script.php one

I tried unset($argv[2]) and unset($GLOBALS['argv'][2]) but this does not work. Is it after all possible what I am trying to do ?

UPDATE:
Does not work = I get exception from third party code “Too many arguments”

UPDATE: of course it should be argv[1], but it is a typo only in this question, not in the actual problem. Please assume I have written argv[1] 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:08:33+00:00Added an answer on June 12, 2026 at 2:08 am

    Manipulating $argc and $argv from within a php script is not possible AFAIK. This is because the values are not part of the script itself, but defined in the calling scope.

    As an alternative you could copy the array, pop the last argument and call the “third party code” by using exec() or system() and handing over the reduced copy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not sure this is possible, but looking to write a script that would return
I am not sure if this is possible, but I assume it is; I
I'm not sure if this possible but probably is fairly simple. I've made a
I'm not sure this is even possible but I know if it is, the
I'm not sure if this is possible but I want to see objects created
I'm not sure if this is possible but I'd like to be able to
I'm not sure if this is possible but as I was looking for a
I'm not sure this is possible, but in ruby, you can dynamically call a
I'm not sure this is possible, but is there a syntax to be used
Not sure if this is possible in one Makefile alone, but I was hoping

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.