Question

I don't know if it should be here but, I'm using this

$filepath = 'export/subscriberslist.csv';
        $this->directory->create('export');
        $stream = $this->directory->openFile($filepath, 'w+');
        $stream->lock();

        $header = ['Id', 'Email', 'Grupo'];
        $stream->writeCsv($header);

And with variables with a foreach writing newsletter subscribers emails and group, but some of them don't have an email, so I wanted, in the end of the write, to search for the lines that has no email then delete that lines so they don't pollute the csv with lines with no info at all.

How can I do this?

Thanks for your time, Rui Silva

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top