How can I echo a php array to the jquery $.each function?
Here's what I tried so far in php...
$index = 0;
while(!feof($file))
{
$singleLine = fgets($file);
$totalLines[$index] = $singleLine;
++$index;
}
echo $totalLines;
Here's how I'm reading it back in jquery...
$.post("sendFile.php",{fileName: sendFileName}, function(data)
{
$.each(data, function(index, value)
{
alert(value);
});
});
The output is giving me Array...when it should be giving me Test1, Test2, Test3 for each array element...