title: How to start a GET/POST/PUT/DELETE request and judge request type in PHP?
body: <p>I never see how is <code>PUT/DELETE</code> request sent.</p>
  
  <p>How to do it in PHP?</p>
  
  <p>I know how to send a GET/POST request with curl:</p>
  
  <pre><code>$ch = curl_init();
  curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile);
  curl_setopt($ch, CURLOPT_COOKIEFILE,$cookieFile);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch,   CURLOPT_SSL_VERIFYPEER,   FALSE);
  curl_setopt($ch, CURLOPT_POST, 0);
  curl_setopt($ch, CURLOPT_TIMEOUT, 4);
  </code></pre>
  
  <p>But how to do <code>PUT</code>/<code>DELETE</code> request?</p>