vraag over array
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
$path = $_SERVER['DOCUMENT_ROOT'] . '/bestand.php';
require_once($path);
$hours = array(
'mon' => array('08:00-21:00'),
'tue' => array('08:00-21:00'),
'wed' => array('08:00-21:00'),
'thu' => array('08:00-21:00'), // Open late
'fri' => array('08:00-21:00'),
'sat' => array('08:00-21:00'),
'sun' => array('12:00-18:00'),
);
// OPTIONAL
// Add exceptions (great for holidays etc.)
// MUST be in format month/day
// Do not include the year if the exception repeats annually
$exceptions = array(
);
// OPTIONAL
// Place HTML for output below. This is what will show in the browser.
// Use {%hours%} shortcode to add dynamic times to your open or closed message.
?>
$path = $_SERVER['DOCUMENT_ROOT'] . '/bestand.php';
require_once($path);
$hours = array(
'mon' => array('08:00-21:00'),
'tue' => array('08:00-21:00'),
'wed' => array('08:00-21:00'),
'thu' => array('08:00-21:00'), // Open late
'fri' => array('08:00-21:00'),
'sat' => array('08:00-21:00'),
'sun' => array('12:00-18:00'),
);
// OPTIONAL
// Add exceptions (great for holidays etc.)
// MUST be in format month/day
// Do not include the year if the exception repeats annually
$exceptions = array(
);
// OPTIONAL
// Place HTML for output below. This is what will show in the browser.
// Use {%hours%} shortcode to add dynamic times to your open or closed message.
?>
In de $template array(
'open' => "<h3>open {%hours%} uur.</h3>",
'closed' => "<h3>dicht {%hours%} uur.</h3>",
);
moet ook de mon.tue.wed,thu,fri,sat,sun array worden opgenomen onder 'open' => en 'closed'
is dit mogelijk enzo ja hoe, dit is een grote stap voor mijn learning curve.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
$template = array(
'open' => "<h3>open {%hours%} uur.</h3>",
'closed' => "<h3>dicht {%hours%} uur.</h3>",
'closed_all_day' => "<h3>Gesloten</h3>",
'separator' => " - ",
'join' => " and ",
'format' => "G:i", // options listed here: http://php.net/manual/en/function.date.php
'hours' => "{%open%}{%separator%}{%closed%}"
);
// Instantiate class and call render method to output content
$store_hours = new StoreHours($hours, $exceptions, $template);
$store_hours->render();
?>
$template = array(
'open' => "<h3>open {%hours%} uur.</h3>",
'closed' => "<h3>dicht {%hours%} uur.</h3>",
'closed_all_day' => "<h3>Gesloten</h3>",
'separator' => " - ",
'join' => " and ",
'format' => "G:i", // options listed here: http://php.net/manual/en/function.date.php
'hours' => "{%open%}{%separator%}{%closed%}"
);
// Instantiate class and call render method to output content
$store_hours = new StoreHours($hours, $exceptions, $template);
$store_hours->render();
?>
Edit:
UBB-codes even gefixed met code en php-tags
Gewijzigd op 23/04/2015 12:14:17 door - Ariën -