This article is about how to read the CSV files using PHP. I have implemented simple and easy way of handling the CSV file in PHP. I have used PHP inbuilt function called fgetcsv to open and read CSV files. You can use this method to insert the CSV data to MYSQL database.
PHP read csv file:
Now lets see how the code look like. As i mentioned earlier we have used php function called fgetcsv(). This function will gets line from file pointer to parse for CSV fields and return an array.
Above function will return you a set of data in php array format. You can go through a loop and insert to database also.
0 التعليقات:
إرسال تعليق