CSV File Data

First Name Last Name Company Name Email Phone Extension City
LeanneGrahamRomaguera-CronaSincere@april.biz1770736803156442Gwenborough
ErvinHowellDeckow-CristShanna@melissa.tv010692659309125Wisokyburgh
ClementineBauchRomaguera-JacobsonNathan@yesenia.net14631234447McKenziehaven
PatriciaLebsackRobel-CorkeryJulianne.OConner@kory.org4931709623156South Elvis
ChelseyDietrichKeebler LLCLucio_Hettinger@annie.ca2549541289Roscoeview
DennisSchulistConsidine-LockmanKarley_Dach@jasper.info147793584786430South Christy
KurtisWeissnatJohns GroupTelly.Hoeger@billy.biz2100676132Howemouth
NicholasRunolfsdottir VAbernathy GroupSherwood@rosamond.me5864936943140Aliyaview
GlennaReichertYost and SonsChaim_McDermott@dana.io775976679441206Bartholomebury
ClementinaDuBuqueHoeger LLCRey.Padberg@karina.biz0246483804Lebsackbury
Name
Leanne Graham
Company
Romaguera-Crona
Email
Sincere@april.biz
Phone
17707368031 Ext. 56442
City
Gwenborough
Name
Ervin Howell
Company
Deckow-Crist
Email
Shanna@melissa.tv
Phone
0106926593 Ext. 09125
City
Wisokyburgh
Name
Clementine Bauch
Company
Romaguera-Jacobson
Email
Nathan@yesenia.net
Phone
14631234447 Ext.
City
McKenziehaven
Name
Patricia Lebsack
Company
Robel-Corkery
Email
Julianne.OConner@kory.org
Phone
4931709623 Ext. 156
City
South Elvis
Name
Chelsey Dietrich
Company
Keebler LLC
Email
Lucio_Hettinger@annie.ca
Phone
2549541289 Ext.
City
Roscoeview
Name
Dennis Schulist
Company
Considine-Lockman
Email
Karley_Dach@jasper.info
Phone
14779358478 Ext. 6430
City
South Christy
Name
Kurtis Weissnat
Company
Johns Group
Email
Telly.Hoeger@billy.biz
Phone
2100676132 Ext.
City
Howemouth
Name
Nicholas Runolfsdottir V
Company
Abernathy Group
Email
Sherwood@rosamond.me
Phone
5864936943 Ext. 140
City
Aliyaview
Name
Glenna Reichert
Company
Yost and Sons
Email
Chaim_McDermott@dana.io
Phone
7759766794 Ext. 41206
City
Bartholomebury
Name
Clementina DuBuque
Company
Hoeger LLC
Email
Rey.Padberg@karina.biz
Phone
0246483804 Ext.
City
Lebsackbury
Download CSV file

The above table displays data taken from a CSV file. The CSV file was created using json data taken from an API.

THINGS I DID

  1. Read in json data from the API.
  2. Separated out the extensions from the original telephone numbers, and gave the extension numbers their own column.
  3. Formatted the remaining telephone numbers by removing special characters.
  4. Validated email addresses and only display those that are valid.
  5. Created a new CSV file and wrote the manipulated data to it with correct column headers.
  6. Read in the new CSV file to create a HTML table for displaying to the page.

Things to bear in mind during this project, were the location of the newly created CSV file, and the permissions set for that location, in order to be able to write to the correct directory.

HELPFUL HINTS

  1. If using this project locally, you will be able to find your root directory using this command anywhere in your php code: echo getcwd();
  2. If the location looks to be correct, and you have issues creating the CSV file, set the permissions for that directory using this command in a terminal, once you have navigated to it's parent: chmod 777 root-folder-name