How to Read Tab Delimited File Using PHP

Basic example to read tab delimited file

$fp = fopen('mydata.csv', 'r');

while ( !feof($fp) )
{
$line = fgets($fp, 2048);

$someCondition = someConditionToDetermineTabOrComma();

$delimiter = $someCondition ? "," : "\t";
$data = str_getcsv($line, $delimiter);

doSomethingWithData($data);
}

fclose($fp);

15 Trackbacks / Pingbacks

  1. pills for ed
  2. erectile dysfunction medicines
  3. online cialis
  4. over the counter viagra
  5. men's ed pills
  6. cialis 10 mg
  7. canadian pharmacy
  8. Get cialis
  9. levitra price
  10. buy vardenafil
  11. levitra price
  12. golden nugget online casino
  13. buy cialis
  14. hollywood casino online
  15. viagra discount

Comments are closed.