title: How to get curl option with string
body: <p>I am working with PHP 5.3 and Curl.</p>
  
  <p>I want to make my curl calls more flexible so one function can handle all my calls. The problem I am having is with the curl option.</p>
  
  <p>It uses values like CURLOPT_POST to represent a LONG value.</p>
  
  <p>To make my function more flexible, I want to set these options with defaults, and change them based on a passed array.</p>
  
  <p>ex;</p>
  
  <pre><code>function doCurl($options){
     $defaults = array('CURLOPT_POST' =&gt; true, 'CURLOPT_HEADER' =&gt; false);
     foreach($options AS $k=&gt;$v) $defaults[$k] = $v;
     foreach($defaults AS $opt_k=&gt;$v) curl_setopt($curl, $opt_k, $v)
  </code></pre>
  
  <p>}</p>
  
  <p>So, how can I handle $opt_k so it can get the LONG value of the original variable?</p>