title: PHP - iterate through array and only show certain values
body: <p>I am trying to show a selection of transactions using PHP and Paypal's NVP <code>TransactionSearch</code> method.</p>
  
  <p>I successfully get the transactions to appear but i cannot tidy the response up and show only the specific values i am after - in this case being just the following 4 values per transaction: </p>
  
  <pre><code>L_TIMESTAMP, 
  L_TYPE, 
  L_TRANSACTIONID
  </code></pre>
  
  <p>My current code is:</p>
  
  <pre><code>$request = http_build_query(array(
      "METHOD"    =&gt; $action,
      "VERSION"   =&gt; $config['version'],
      "USER"      =&gt; $config['username'],
      "PWD"       =&gt; $config['password'],
      "SIGNATURE" =&gt; $config['signature'],
      "STARTDATE" =&gt; $start,
      "EMAIL" =&gt; $email,
  ));
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_VERBOSE, 1);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_POST, 1);    
  curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
  
  $result = curl_exec($ch);
  
  if (!$result) {
      echo 'no results';
  }
  
  parse_str($result, $result);
  
  foreach($result as $key =&gt; $value){
      echo $key.' =&gt; '.$value."&lt;br /&gt;";
  }
  </code></pre>
  
  <p>which outputs everything in one as below :</p>
  
  <pre><code>L_TIMESTAMP0 =&gt; 2014-01-15T11:29:21Z
  L_TIMESTAMP1 =&gt; 2014-01-15T11:09:05Z
  L_TIMEZONE0 =&gt; GMT
  L_TIMEZONE1 =&gt; GMT
  L_TYPE0 =&gt; Refund
  L_TYPE1 =&gt; Payment
  L_TRANSACTIONID0 =&gt; 7MY22222222222914
  L_TRANSACTIONID1 =&gt; 2045555555555594D
  
  and so on...
  </code></pre>
  
  <p>How can i instead output it like this: (so it goes through each transaction then the next rather than each 'value' and onto the next, plus not show the TIMEZONE key)</p>
  
  <pre><code>L_TIMESTAMP0 =&gt; 2014-01-15T11:29:21Z
  L_TYPE0 =&gt; Refund
  L_TRANSACTIONID0 =&gt; 7MY22222222222914
  
  L_TIMESTAMP1 =&gt; 2014-01-15T11:09:05Z
  L_TYPE1 =&gt; Payment
  L_TRANSACTIONID1 =&gt; 2045555555555594D
  </code></pre>