PHP read csv file, save in variable, and display in the browser

In this case, we would like to read comma separated value (csv) than save in the php variable and display to the browser.

For example, we have csv file with name data.csv and containing data looks like below:

Create a php file for example readcsv.php. The PHP code is looks like below:

Open php file in the browser and it will display csv data in the array format.

Read :   Mencoba Sphider PHP Search Engine



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.