section-engineering-education / engineering-education

“Section's Engineering Education (EngEd) Program is dedicated to offering a unique quality community experience for computer science university students."
Apache License 2.0
364 stars 890 forks source link

How to Handle CSV with PHP: Read Write, Import Export with Database #3782

Closed Kama-144 closed 2 years ago

Kama-144 commented 3 years ago

Proposed title of the article

How to Handle CSV with PHP: Read Write, Import Export with Database

Introduction paragraph (2-3 paragraphs):

CSV is one of the familiar file formats and is used widely by programmers for handling data. The simplicity of the format and human-readable form made it so popular. CSV stands for Comma-Separated Values. In earlier days, the delimiter was only a comma (,) and so the name CSV. Nowadays, CSV files use tab-demitted row data too.

To handle CSV with PHP, we must be aware there is excellent support in-built with core PHP. Knowledge about those built-in libraries and functions will be handy in handling CSV files. This article will gracefully handle CSV with PHP

Key takeaways:

  1. CSV file format and MIME type
  2. How to convert PHP Array to CSV?
  3. CSV file data validation
  4. How to import large CSV files?
  5. How to split large CSV files and process using PHP?
  6. How to read encoded CSV files with special characters?
  7. Convert CSV file to HTML table using PHP
  8. Process CSV file with comma data values using PHP
  9. Export database records to CSV in a generic way
  10. How to export CSV using fputcsv?
  11. Download as CSV File via browser using Content-Type
  12. Read CSV using PHP built-in functions

    References:

    N/A

WanjaMIKE commented 3 years ago

Good afternoon and thank you for submitting your topic suggestion. @Kama-144 Your topic form has been entered into our queue and should be reviewed (for approval) as soon as a content moderator is finished reviewing the ones in the queue before it.

hectorkambow commented 3 years ago

@Kama-144 How will this article differ from what is published our other blog sites

Kama-144 commented 3 years ago

Before suggesting this issue I went through some of the published content in the Internet and I found out that most of them are not begginers friendly in that for those who are only familiar with procedural php are disadvantaged since most them employ PDO.My article will be able to address not only PDO and Procedural PHP but also oop php for the benefit of everyone😊

hectorkambow commented 3 years ago

🤔

Sounds like a helpful topic - lets please be sure it adds value beyond what is in any official docs and/or what is covered in other blog sites. (the articles should go beyond a basic explanation - and it is always best to reference any EngEd article and build upon it).

Please be attentive to grammar/readability and make sure that you put your article through a thorough editing review prior to submitting for final approval. (There are some great free tools that we reference in EngEd resources.) ANY ARTICLE SUBMITTED WITH GLARING ERRORS WILL BE IMMEDIATELY CLOSED. Please be sure to double check that it does not overlap with any existing EngEd articles, articles on other blog sites, or any incoming EngEd topic suggestions (if you haven't already) to avoid any potential article closure, please reference any relevant EngEd articles in yours. - Approved

mercymeave commented 3 years ago

Hello @kama-144,

Another student suggested the same topic here, have you checked to confirm that there is no overlap?

cc: @hectorkambow , @WanjaMIKE