You will need to have permissions to write the file. If you remove a row, you will have to save the file. As you do not want to have any empty rows as well, you need to read the whole file.
I suggest to get the file content, and split it into a array by lines. With the explode function you can split the content by the line break, most likely "
". So an array wich will contain each line of the csv file will be existing. Now you can simply remove the line from the array and create a string out of it, before saveing the changed content back to the csv file.
// get csv content into string variable
$csvContent = file_get_contents(__DIR__ . "/yourfile.csv");
// create array out of csv, limited by PHP_EOL wich determines the systems line break
// this means, every line in the csv file will be represended by an array key and its value
$csvArray = explode(PHP_EOL, $csvContent);
// unset the 3th csv line.
unset($csvArray[2]); // keep in mind array starts at 0, so third line is array key 2
// from here on you can manipulate the array $csvArray as you like.
// add lines, remove lines or just use the given content for future operations.
// you can also iterate over the array with: foreach ($csvArray as $line => $value) {}
// create string out of modified csv array
$csvContent = implode(PHP_EOL, $csvArray);
// save result back into the csv file
file_put_contents( __DIR__ . "/yourfile.csv", $csvContent);
Check implode/explode php function docs:
http://php.net/manual/en/function.implode.php
http://php.net/manual/en/function.explode.php