*EDIT
I seem to be having some trouble with the fgetcsv function. In my code I am trying to create a single row array with each tab separated value as a separate element in the array. Instead of returning just the first value, $data[0] is returning the entire line. The problem seems to be that I don't have the right delimiter in fgetcsv, "/t" is not working. Any ideas how to fix this?
Here is my code,
#!/usr/bin/env php
<?php
require ("../includes/functions.php");
//argument argv[1] == the relative path
if (!file_exists($argv[1]))
{
print("The file you chose does not exist.");
}
if(!is_readable($argv[1]))
{
print("The file you chose is not readable");
}
else
{
$handle=fopen($argv[1], "r");
$data = fgetcsv($handle, "\t");
print($data[0]);
}