PHP string str_getcsv() FunctionThe str_getcsv() is in-built PHP string function. It is important function which is used to parse a CSV string into an array. Syntax:
Example 1//Create 'data.csv' File Output: Note: If "data.csv" file is not found then it will return error.Example 2// create "data.csv" and save : //Save it: test.php Output: Array ( [0] => 101 [1] => Alok Nandan [2] => is [3] => Learning [4] => PHP [5] => from [6] => JavaTpoint ) Example 3Output: 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 String |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India