title: Why does this command output an empty array of the expected size instead of one with the elements filled in?
body: <p>I want to have a user type in several lines into a textarea and then have php assign them to an array, however the code I have seems to assign blank values to the array</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtm$
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;Juniper to IOS Translator&lt;/h1&gt;
  
  &lt;form method="post" action="query.php"&gt;
   &lt;textarea name="txtarea" style="width: 80%; height: 25em;"&gt;
   &lt;/textarea&gt;
   &lt;input type="submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>PHP:
      
      </p>
  
  <pre><code>&lt;?php
  
  $text = $_POST["txtarea"];
  
  echo nl2br($text);
  echo "&lt;br /&gt;" , "&lt;br /&gt;";
  
  $data = preg_split("/((?&lt;=\n).*?(?=\n))/", $text , -1, PREG_SPLIT_NO_EMPTY);
  
  print_r(array_values($data));
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>With the input:</p>
  
  <pre><code>Line with stuff 
  Line with stuff more
  Line with stuff more more
  Line with stuff more more more
  Line with stuff more more more more
  </code></pre>
  
  <p>I get the output:</p>
  
  <pre><code>Line with stuff 
  Line with stuff more
  Line with stuff more more
  Line with stuff more more more
  Line with stuff more more more more
  
  
  Array ( [0] =&gt; [1] =&gt; [2] =&gt; [3] =&gt; [4] =&gt; [5] =&gt; )
  </code></pre>
  
  <p>am I passing the array wrong? is my regex wrong?</p>