Bam, atholon fail, you'd use the function explode();
Here you go:
Code:
<?php
$file = fopen("yourfile.csv", "r") or exit("Unable to open file!");
// Row array
$rows = array();
while(!feof($file))
{
$columnString = fgets($file);
$columns = explode(",", $columnString);
// Add the array of column items to the row
$rows[] = $columns;
}
// This would return ALL the data to the javascript with AJAX
echo(json_encode($rows));
?>
You could get away with making multiple AJAX requests and having the code behind filter it but I suggest just doing one AJAX request at the time the page loads. That way you don't have the annoying delay while the results are passed back.