Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here is the code I have so far ... I just need some help finishing it! Please complete all parts of the question. Thank you

image text in transcribed

Here is the code I have so far... I just need some help finishing it! Please complete all parts of the question. Thank you :)

image text in transcribed

Code to Copy and Paste:

/* $csv='John;Lennon'; writeCSV('beatles.csv',$csv); $csv='Paul;McCartney'; writeCSV('beatles.csv',$csv); */ echo '

'; print_r(readCSV('beatles.csv')); 

function writeCSV($file,$data){ $h=fopen($file,file_exists($file) ? 'a' : 'w+'); fwrite($h,$data. " " /* PHP_EOL */); fclose($h); }

function readCSV($file){ $h=fopen($file,'r'); $output=''; while(!feof($h)) $output.=fgets($h); fclose($h); $output=explode(" ",$output); unset($output[count($output)-1]); for($i=0;$i

/* *read all the records from a CSV file *read the record with index i in the CSV file *modify the record with index i in the CSV file *delete the record with index i from the CSV file */

The task for the assigment is to work on csv.php and complete it with functions that read all the records from a CSV file read the record with index i in the CSV file modify the record with index i in the CSV file delete the record with index i from the CSV file 1 '; print_r(readcsv ('beatles.csv')); function writecsv($file, $data) { $h=fopen($file, file_exists($file) ? 'a': 'w+'); fwrite($h, $data. " " /* PHP_EOL */); fclose($h); } 15 16 18 19 function readcsv ($file) { $h=fopen($file,'r'); $output=''; while(!feof ($h)) $output.=fgets($h); fclose($h); $output=explode(" ",$output); unset($output[count($output)-1]); for($i=0; $i'; print_r(readcsv ('beatles.csv')); function writecsv($file, $data) { $h=fopen($file, file_exists($file) ? 'a': 'w+'); fwrite($h, $data. " " /* PHP_EOL */); fclose($h); } 15 16 18 19 function readcsv ($file) { $h=fopen($file,'r'); $output=''; while(!feof ($h)) $output.=fgets($h); fclose($h); $output=explode(" ",$output); unset($output[count($output)-1]); for($i=0; $i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions