title: How can I parse command line arguments in PHP?
body: <p>I call a PHP script from command line <code>$ php my_script.php --num1=124 --first_name=don</code></p>
  
  <p>How can I get access to <em>any</em> key value pairs passed into this script? The keys can be arbitrary, so using <code>getopt()</code> with particular values will not work.</p>
  
  <p>Here is what I want access to in my script:</p>
  
  <pre><code>$my_args = array(
    "num1" =&gt; 124,
    "first_name" =&gt; "don"
  );
  </code></pre>
  
  <p>If I use <code>var_dump($argv)</code>, I get this output:</p>
  
  <pre><code>array(
    [0] =&gt; "my_script.php",
    [1] =&gt; "--num1=5",
    [2] =&gt; "--num2=123"
  );
  </code></pre>
  
  <p>Should I just look</p>