A comma-separated values (CSV) (also sometimes called character-separated values, because the separator character does not have to be a comma) file stores tabular data (numbers and text) in plain-text form. Plain text means that the file is a sequence of characters, with no data that has to be interpreted instead, as binary numbers. { wiki }. We need to upload .csv file to server before we read data from file. I assume that you already know how we can upload any file to server using form. After uploading file to server we open that file using PHP fopen() function and read data and insert data to database from file as display below in code.