😕 I am new in php and need your help.
How can I convert two different csv files into array and use them in php.
Example
$fh = fopen("test.csv", "r");
while (list($dat1, $dat2, $dat3, $dat4, $dat5, $dat6, $dat7, $dat8, $dat9, $dat10, $dat11) = fgetcsv($fh, 1024, ","))
{
if ($dat3 =="A" or $dat3 =="B" or $dat3 =="C") {
$link1 = '<td class="sp_cell"><a target="_blank" href="http://....A=';
$link1 .=$dat1;
$link1 .= '">';
$link1 .=$dat1;
$link1 .= '</a></td>';
$data_array1= array($dat1); // This is what I would like to know and how can I use this in later steps??????
echo <<<END
$link1
END;
Then I would like to use data array
<?php
foreach($values as $data) {
$fp = fopen ("test2.csv","r");
$data2 = fgetcsv ($fp, 1000, ",");
$data_array2 = array($data2); // This is what I would like to know and how can I use this in later steps??????
?>
Then I wold like to fill a table using $data_array1 and $data_array2 in a loop.
Best Regards.