On a website I am creating, I have the store 'open hours' in three locations on one page. One in the header, one in the body and one in the footer. I am trying to pull these in with PHP for simplicity when updating. I wrote an array:
<?php
$UniqID = uniqid(day);
$day1 = 'Mon-Fri: 9:00a-5:00p';
$day2 = 'Saturday: 9:00a-1:00p';
$day3 = 'Sunday: CLOSED';
$days = array(
"1" => "<span id=" . $UniqID . " class='editable-text'>" . $day1 . "</span>",
"2" => "<span id=" . $UniqID . " class='editable-text'>" . $day2 . "</span>",
"3" => "<span id=" . $UniqID . " class='editable-text'>" . $day3 . "</span>",<
);
?>
and then am calling it on the page as such:
<span>Address | Phone <br/> Our Hours: <?php echo $days[1] ?>, <?php echo $days[2] ?>, <?php echo $days[3] ?></span>
The problem I have is that I need a unique ID EVERY time these are called to the page, and obviously this gives a unique ID for 1, 2 and 3 - but if I call that same thing on the page 2 or 3 times... well, then all three of the first instances have the same ID and so on.
So to sum it all up, I want to create an array that stores the hours like above - and be able to call them to the page however many times necessary but always get a unique ID wherever they show up.
Any help is appreciated, I can't process this anymore!