how to echo a php array to the jquery $.each method
<p>How can I echo a php array to the jquery $.each function?</p>

<p>Here's what I tried so far in php...</p>

<pre><code>                  $index = 0;

                  while(!feof($file))
                  {
                     $singleLine = fgets($file);
                     $totalLines[$index] = $singleLine;

                     ++$index;
                  }
                  echo $totalLines;
</code></pre>

<p>Here's how I'm reading it back in jquery...</p>

<pre><code>       $.post("sendFile.php",{fileName: sendFileName}, function(data)
       {
              $.each(data, function(index, value)
              {
                        alert(value);
              });
       });
</code></pre>

<p>The output is giving me Array...when it should be giving me Test1, Test2, Test3 for each array element...</p>
