アットウィキロゴ

fgetcsv

<html>
<head>
<title>Example</title>
</head>
<body>
<?php
$row = 1;
$handle = fopen("sample.csv", "r");
$n = 1;
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
for ($c=0; $c < 3; $c++) {
$bdata[$n] = $data[$c];
$n = $n +1;      
}
}
fclose($handle);
for ($n=1; $n < 82; $n++) {
echo $bdata[$n]. "<br />\n";
}
?>
</body>
</html>
最終更新:2009年04月28日 07:47