stephenlk Posted July 2, 2008 Share Posted July 2, 2008 I'm just learning the basics of php, so I apologize if the error is obvious. <?php function addition($val1, $val2) { $sum = $val1 + $val2; return $sum; } if (addition(5. 6) == 11) { echo "Yes"; } ?> I keep getting a syntax error and I'm clueless to as why. Much help would be appreciated. Link to comment https://forums.phpfreaks.com/topic/112962-solved-what-is-wrong-with-this-code/ Share on other sites More sharing options...
Tchelo Posted July 2, 2008 Share Posted July 2, 2008 values are separated by commas, so your function should be called as if (addition(5, 6) == 11) { Link to comment https://forums.phpfreaks.com/topic/112962-solved-what-is-wrong-with-this-code/#findComment-580244 Share on other sites More sharing options...
stephenlk Posted July 2, 2008 Author Share Posted July 2, 2008 Thanks. Link to comment https://forums.phpfreaks.com/topic/112962-solved-what-is-wrong-with-this-code/#findComment-580245 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.