使用php将数据添加到CSV文件

I have a CSV file containing approx. 15k products. The only data is the products SKU. There also is no header in the file. Only 15k lines with product SKUs. What I want is to do is a:

Create two headers: sku, is_in_stock

I want to have all the sku rows in the sku column (obviously) and I want 15k lines with the value 1 in the is_in_stock column.

Then save the values to the file.

I have searched the internet for MANY hours trying to figure this out, but no luck. I'm about to give up.

So this is my cry for help, and if someone has done anything like this before or have the knowledge on how it could be done I would be super happy =)

I have some knowledge of php from 10 years ago, so I am almost as limited as it gets in regards to knowledge on the matter.

Thanks for your time,

Ståle.

I guess this is all you need

$old = fopen('file.csv','r');
$new = fopen('new.csv','w+');
while($line = fgetcsv($old))
{
    fputcsv($new,$line.",1");
}
fclose($old);
fclose($new);