I have written a PHP script that reads a CSV file and publishes the resulting radio schedule on a website based on time and date. However, it appears it will be released twice.
The following is the script content:
= $time) { $filteredData[] = $row; } } // Step 5: Display the filtered data with CSS classes for each row if (count($filteredData) > 0) { foreach ($filteredData as $row) { echo ""; echo ""; } } else { echo 'Not available.'; }"; echo ""; echo ""; echo ""; echo ""; echo "$row[2]
"; echo "
$row[3]
This is the data I tested with in a CSV file:
Friday,12,MMV,until 1pm,top_mmv.png Friday,13,MMV,until 2pm,top_mmv.png Friday,14,MMV,until 3pm,top_mmv.png Friday,15,MMV,until 4pm,top_mmv.png
But when it gets to 2pm on Friday, it posts both the 1pm and 2pm rows. What did I do wrong?
You need to specify the conditions for collecting data,
For example, the current time now is 14 o'clock (add 1 hour is your adjustment).
$Hour >= $time
I think you can see where the problem is.