PHP fgetcsv() FunctionThefgetcsv() function is used to get a line from file pointer and parse for CSV fields. Well, it is similar to fgets() function, but it parses the lines in CSV format, and it returns an array that contains the fields to read. SyntaxParameters
ReturnsIt returns an indexed array. Example 1Output: Array ( [0] =>rosie [1] =>wan [2] =>starr [3] => Norway ) Array ( [0] =>somya [1] =>aksahy [2] =>dhanush [3] =>India ). Example 2Output: Array ( [0] => 1 [1] => PEN [2] => red ) Array ( [0] => 2 [1] => Book [2] => green ) Or Array ( [0] => 1 [1] => PEN [2] => red ) Array ( [0] => 2 [1] => Book [2] => green )
Next TopicPHP Filesystem
|