title: What does curl_exec return?
body: <p>I'm trying to set an API with a payment processor. Below is the code they provided me. There are some information in the $result variable that I want, what I don't understand is what type of variable is '$result' and how can I take certain data from it. printing the $result shows &quot;Transaction ID is : xxxx  status is ACCEPTED&quot;. What I basicly want is to take only the transaction ID and store it in a variable.</p>
  <pre><code>foreach($_POST as $k=&gt;$v) $$k=urldecode($v); 
  $urladdress = &quot;https://example.com/accapi/process.php&quot;; 
  $api_id = &quot;dddd&quot;; 
  $api_pwd = &quot;yyyyy&quot;; 
  $api_pwd = md5($api_pwd.'s+E_a*'); 
  $data = &quot;user=&quot;.$user. &quot;&amp;testmode=&quot;.$testmode.&quot;&amp;api_id=&quot;.$api_id. &quot;&amp;api_pwd=&quot;.$api_pwd.&quot;&amp;amount=&quot;.$amount.&quot;&amp;paycurrency=&quot;.$currency.&quot;&amp;comments=&quot;.$comments.&quot;&amp;fee=&quot;.$fee.&quot;&amp;udf1=&quot;.$udf1;
  // Call STP API
  
  $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,&quot;$urladdress&quot;); 
  curl_setopt($ch, CURLOPT_POST, 1); 
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
  curl_setopt($ch, CURLOPT_HEADER, 0); //use this to suppress output 
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);// tell cURL to graciously accept an SSL certificate 
  $result = curl_exec ($ch) or die(curl_error($ch)); 
  echo $result; 
  echo curl_error($ch); 
  curl_close ($ch);
  </code></pre>