This below script is a portion of a script that loops through a store locator a returns multiple address and phone numbers for multiple store locations. Can someone tell me the best way to add the values to an array and export them to csv on the below line that starts with "if(!empty($address)&&!empty($phone))"
<?php
foreach($Lines as $Line)
{
if (strstr($Line, 'addre')) // EXAMPLE ONLY!
{
$counter=$counter+1;
$strTag="True";
$address=$Line;
}
if ($counter==6)
{
$phone=$Line;
$strTag="False";
$counter=0;
}
If ($strTag!="False")
{
$counter=$counter+1;
}
if(!empty($dealername)&&!empty($address))
{
//I need to assign to an associtive array here
}
}
//I need to output the entire file to .csv here.
?>