Results 1 to 5 of 5

Thread: File arguments

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Resolved File arguments

    If I run the PHP interpreter like this

    php some.php something

    Can I get the "something" like I get it with static void Main(string[] args) on other language?

    Thanks.
    Last edited by nebulom; Jul 31st, 2007 at 12:16 AM.

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: File arguments

    It's $_SERVER['argv']

  3. #3
    Hyperactive Member
    Join Date
    Dec 2006
    Location
    Ubuntu Haters Club
    Posts
    405

    Re: File arguments

    You can use $argv for the argument values, and $argc for the argument count.
    » Twitter: @rudi_visser : Website: www.rudiv.se «

    If Apple fixes security flaws, they are heralded as proactive. If Microsoft fixes a security flaw, they finally got around to fixing their buggy OS.

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: File arguments

    Quote Originally Posted by RudiVisser
    You can use $argv for the argument values, and $argc for the argument count.
    Yes, as long as register_argc_argv is on.
    Using $_SERVER is preferable as you can rely on that being available.

  5. #5
    Hyperactive Member
    Join Date
    Dec 2006
    Location
    Ubuntu Haters Club
    Posts
    405

    Re: File arguments

    I've never seen a server of which that isn't available, plus it's enabled by default and there's no reason to change it.
    » Twitter: @rudi_visser : Website: www.rudiv.se «

    If Apple fixes security flaws, they are heralded as proactive. If Microsoft fixes a security flaw, they finally got around to fixing their buggy OS.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width