|
|
|
อ่านค่าจากไฟล์ .txt แล้วเก็บค่าไว้ใน Array ทำไงครับ PHP |
|
|
|
|
|
|
|
ง่าไม่มีใครช่วยเลย อิอิ
|
|
|
|
|
Date :
2011-09-08 10:11:34 |
By :
wisadacha |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
csv1.csv
1,11,111,1111
1,11,111,1111
1,11,111,1111
csv2.csv
2,22,222,2222
2,22,222,2222
2,22,222,2222
csv3.csv
3,33,333,3333
3,33,333,3333
3,33,333,3333
Code (readcsv.php)
<?
$arr[] = null;
$objScan = scandir("csv");
foreach ($objScan as $value) {
if($value != "." and $value != "..")
{
$strFileName = "csv/".$value;
$objFopen = fopen($strFileName, 'r');
if ($objFopen) {
while (!feof($objFopen)) {
$file = fgets($objFopen, 4096);
$arr[] = $file;
}
fclose($objFopen);
}
}
}
for($i=0;$i<count($arr);$i++)
{
echo $arr[$i]."<br>";
}
?>
screenshot
|
|
|
|
|
Date :
2011-09-08 16:11:39 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|