title: PHP fsockopen to curl conversion
body: <p>i have this piece of code:</p>
  
  <pre><code>&lt;?php $host = "registration.mypengo.com";
  $request = "/webregistration.aspx?taskaction=serviceresponse&amp;partner=157&amp;subid=" . $subid . "&amp;msisdn=" . $msisdn . "&amp;type=TEXT&amp;data=" . $data . "&amp;serviceid=" . $service_id;
  $fp = fsockopen($host, 80, $errno, $errstr, 3.0);
  
  if($fp)
  {
    fwrite($fp,
      "GET $request HTTP/1.0\r\n" .
      "Host: $host\r\n".
      "Connection: close\r\n".
      "Content-Length: " . strlen($request) . "\r\n" .
      "\r\n" .
    $request);
  
    stream_set_timeout($fp, 2, 0);
    $response = "";
  
    while(!feof($fp))
      $response .= fread($fp, 1024);
  
    fclose($fp);?&gt;
  </code></pre>
  
  <p>i want to try it out using curl but i am kinda new to curl so can anyone share some ideas?</p>