Hi, this are some newbie questions, but I can't figure them out for the life of me. I have some code for a drop-down menu, but there are parts of the code I do not understand fully. here is the code, with my question as comments.
<?php
$Q1 = array(
1=>"What is your Mother's Maiden name?",
2=>"What is your Mother's Maiden name?" ,
3=>"What is your Mother's Maiden name?" ,
4=>"What is your Mother's Maiden name?" ,
5=>"What is your Mother's Maiden name?" ,
6=>"What is your Mother's Maiden name?" ,
7=>"What is your Mother's Maiden name?" ,
8=>"What is your Mother's Maiden name?" ,
9=>"What is your Mother's Maiden name?" ,
10=>"What is your Mother's Maiden name?"
);
$Q1 = str_replace(" ", " ", $Q1); //why is this line necessary?
$count = 1;
echo '<SELECT name=Q1>';
foreach ($Q1 as $key => $value)
{
echo '<OPTION value='.$count.'> '.$value.' '; /* why is the . operator needed here for $count and $value? And why do we need the last set of single parenthesis after $value? */
$count++;
}
echo '</select>';
?>
Thank you very much for your time.