Skip to content

Instantly share code, notes, and snippets.

@yesidays
Created May 15, 2012 05:40
Show Gist options
  • Save yesidays/2699390 to your computer and use it in GitHub Desktop.
Save yesidays/2699390 to your computer and use it in GitHub Desktop.
Leer CSV con PHP
<?php
$handle = fopen("test.csv", "r");
$columns = fgetcsv($handle, $max_line_length, ",");
if ($columns != "") {
foreach ($columns as &$column) {
$column = str_replace(".","",$column);
echo $column;
}
echo "<br />";
while (($data = fgetcsv($handle, $max_line_length, ",")) !== FALSE) {
if ($data != "") {
foreach ($data as &$info) {
echo $info;
}
echo "<br/>";
}
}
}
fclose($handle);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment