title: How to get input field value from a form using preg_match()
body: <p>I am not a expert in this field so please help me out and spare my ignorance if any.
  I am trying to curl through a page and want to get value of the hidden <code>&lt;input&gt;</code> field. I am not familiar with regexp. my code is as below:</p>
  
  <pre><code>       $page = curl_exec($ch);
  }
  curl_close($ch);
  
  function parse_form_fields($page, $username, $password){
      preg_match("/&lt;input id=\"signuptoken\" type=\"hidden\" value=\"(.+?)\" name=\"signuptoken\"/", $page, $m);
  
      $captchatoken = $m[1];
  
      $parameters[] = "newaccounttoken=" . urlencode($captchatoken);
  }
  </code></pre>
  
  <p>the form field is as below:</p>
  
  <pre><code>&lt;input id="signuptoken" type="hidden" value="03AHJ_Vuv2ts6ev2LltAkZB91vjD6k-BsW3286bTC9QZYZLSHQUMNDQJFUaNmAQMAYb9FDhIkOFzAisafasfsTZuv_pl5KvkYNfsGUPcOAEX5YPlMaMOi7MZJq4ky0v_GyM60SmMgjPrtfZSJYE0hqw--GsfsafasmER0Sksr6OAvnLnBVAMsKcCi7uM" name="signuptoken"&gt;
  </code></pre>
  
  <p>I want to get the value out for this input field.</p>