I am trying to set a specific line in a CSV file. I tried changing $line, but that (obviously) only changes the variable and not the line. I also tried getting the line number but it´s still a mystery how I can write to this specific line only for me.
My Code:
$file = fopen(WP_CONTENT_DIR."/plugins/coinStats/coin_database.csv","w");
//Search file; If the number is there, get data. If not, create
while (($line = fgetcsv($file)) !== FALSE) {
if (in_array($CoinNumber, $line)) {
$find = $line;
$foundResult = true;
//Change line here?
}
}