0
我想將我的Foo.csv的第一行作爲數組。PHP fgets()數組
Foo.csv:
I, Like, Chocolate
And, Also, Milk
我試圖
//$foo is Foo.csv
$file = fopen($foo, "r")
//First attempt
$fgetsFile = fgets($file)
//Other way
$streamlineFile = stream_get_line($file, 10000, "\n");
fclose($file)
var_dump($fgetsFile) // (String) "I", "Like", "Chocolate"
var_dump($streamlineFile) // (array) [0] => (string) "I", "Like", "Chocolate"
我想用這樣一個數組,結束了:
array([0] => "I", [1] => "Like", [2] => "Chocolate)
確實。我剛剛檢查過。謝謝。 – Wistar 2014-12-05 22:22:59