I have a long list echoed on my screen looks like this:
UVVI0287;PMS340C
UVVI0288;PMS242C
etc
Here's the code:
foreach(glob('./xls/*.*') as $filename){
$final = preg_replace('%^([^ ]+?)( )(.*)$%', '\1;\3', $bodytag);
echo $final;
echo '<br>';
}
Is there a way of saving this output to csv using php?