title: How to only show the first line of print print_r?
body: <p>How do you echo only the first line of print print_r?</p>
  
  <p>More info:</p>
  
  <p>I have this PHP code:</p>
  
  <pre><code>preg_match_all('/MbrDtlMain.php\?([^ ]+)&gt;/i', $string, $matches);
  foreach(end($matches) as $key=&gt; $value){
      print print_r($value, 1).'&lt;br&gt;';
  }
  </code></pre>
  
  <p>That results in:</p>
  
  <pre><code>12567682
  12764252
  12493678
  14739908
  </code></pre>
  
  <p>(or other numbers depending on user input)</p>
  
  <p>I tried:</p>
  
  <pre><code>preg_match_all('/MbrDtlMain.php\?([^ ]+)&gt;/i', $string, $matches);
  foreach(end($matches) as $key=&gt; $value){
      $id = print_r($value, 1).'&lt;br&gt;';
  }
  echo $id
  </code></pre>
  
  <p>But it results in 1 random number from the list. In other words, the result only shows when using print like <code>' print print_r($value, 1).'&lt;br&gt;';'</code>. The problem is that I only want the first, inorder, result to be shown. As if:</p>
  
  <pre><code>$firstlineofnumbers = '12567682';
  echo $firstlineofnumbers;
  </code></pre>
  
  <p>Hope this makes sense. Thanks (:</p>