Archadian Posted February 24, 2007 Share Posted February 24, 2007 Could anyone explain what the arguements inside the () of the function name means? I've read tutorials and im just not getting it lol. Thanks ex: function test(arg1, arg2) {} Link to comment https://forums.phpfreaks.com/topic/39901-solved-help-with-functions/ Share on other sites More sharing options...
paul2463 Posted February 24, 2007 Share Posted February 24, 2007 when you write a function you want to pass it some information to work with, lets start with a simple function <?php function addNumbers($arg1, $arg2) { $answer = $arg1 + $arg2; return $answer; } //run this function echo addNumbers(3,4); //would print out 7 ?> edit: hopefully didnt simplify it too much.... Link to comment https://forums.phpfreaks.com/topic/39901-solved-help-with-functions/#findComment-192877 Share on other sites More sharing options...
Archadian Posted February 24, 2007 Author Share Posted February 24, 2007 ok thanks, thats simple enough....i was thinking it was harder than that, thats why i wasnt understanding it lol Link to comment https://forums.phpfreaks.com/topic/39901-solved-help-with-functions/#findComment-192878 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.