Good day sirs,
I’m undergoing the programme ‘PHP and MySQL’ at your online facility. It should interest you to know that my USER ID is: FRANKLIN4EDUCATION.
I have the following questions and would appreciate an answer proffered to them:
1.
# Is this the symbol used in the examples:
<?php # dateform.php
$page_title = 'Calendar Form';
include ('./includes/header.html');
2. Pls explain these two symbols in the context of usage as show below (line 3 in x; and line 3 in y; in the case of y, I suppose it means that $day ‘is less than or equal to 31’):
3. Pls explain the symbol = as used in line ‘3’ in y. Kindly tell me its name since = = stands for ‘is equal to’.
(x)
// Make the months pull-down menu.
echo '<select name="month">';
foreach ($months as $key => $value) {
echo "<option value=\"$key\">$value</option>\n";
}
echo '</select>';
(y)
// Make the days pull-down menu.
echo '<select name="day">';
for ($day = 1; $day <= 31; $day++) {
echo "<option value=\"$day\">$day</option>\n";
}
echo '</select>';
Thank you.
Franklin.
QUESTIONS
Moderator: General Moderators
Re: QUESTIONS
For starters, when posting code, please wrap it using the code or php tags.
# is commonly used for commenting a line of code, similar to using //
line 3 in x,
'For each element of the $months associative array I want to refer to the key as $key and the value as $value."
Im not entirely sure what your question is...Catalyst wrote:1.
# Is this the symbol used in the examples:
# is commonly used for commenting a line of code, similar to using //
line 3 in x,
PHP Tutorial - For EachCatalyst wrote:foreach ($months as $key => $value) {
'For each element of the $months associative array I want to refer to the key as $key and the value as $value."
This loop sets the variable $day to 1; While $day is less than or equal to 31; increment $day after the loop is completed.Catalyst wrote:for ($day = 1; $day <= 31; $day++) {