2

In following function:

function dateSelect($monthname,$dayname,$yearname) {
   echo "rs: " . $monthname;    
  dropdownDateSelect($monthName, $dayName, $yearName);    
}

$monthname gets echoed out correctly. However, it is empty inside function dropdownDateSelect. I am not sure why. I am getting "Variable $monthName seems to be uninitialized" error message in Netbeans IDE.

function dropdownDateSelect($monthName, $dayName, $yearName){
  echo "rss: " . $monthName;
}

Now in"rss: $monthName", $monthName is empty.

Could you elaborate why this is happening and how I can pass $monthName to dropdownDateSelect function?

Thank you.

Subin Thomas
  • 1,408
  • 10
  • 19
Roshni
  • 189
  • 1
  • 18

1 Answers1

1

You have to be aware of upper- and lowercase as they are not the same in PHP (see also the comments above). So this is how your function will work (with $monthName):

function dateSelect($monthName, $dayName, $yearName) {
    echo "rs: " . $monthName;    
    dropdownDateSelect($monthName, $dayName, $yearName);    
}
Jan
  • 42,290
  • 8
  • 54
  • 79
  • 1
    if that's what it is, great. We'll wait for what the OP has to say ;-) – Funk Forty Niner Oct 26 '15 at 19:11
  • @Fred-ii- [Take this](http://www.comicvine.com/forums/spider-man-167/how-do-you-beat-the-spider-sense-23767/)! I may quote: "When deprived of his spider-sense, Spider-Man becomes vulnerable to surveillance and attack and traveling by web-line requires most of his concentration." – Jan Oct 26 '15 at 19:35
  • @Jan Thank you so much. I am so silly and you caught it so quick. – Roshni Oct 26 '15 at 19:40
  • No worries. Indeed, Subin Thomas and Fred were battling each other in the first place... – Jan Oct 26 '15 at 19:41