This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Functions, Part II Forum

View Course » View Exercise

793 points
5480cd8bd3292f48d3000437_540631683
Submitted by
reverethecode
almost 3 years ago

Funtion Syntax: Please help

Can someone explain to me why you call a function after you've closed it out? I.e. why does this happen outside of the curly braces? Any help would be much appreciated.


0 votes

permalink

if i understood you, you call function to make text more cleary, like, if you wyould do same thing 50 times in diffrent parts of code, it take less place

256 points
E914c626e28715075238f6e14df5b019?s=140&d=retro
Submitted by
Kamil118
over 2 years ago


0 votes

permalink

Functions don't run automatically, calling it just tells PHP to go do the code in the brackets. If you call it inside the brackets, it won't ever run because when PHP sees the function keyword, it doesn't execute the code(until you call it.)You can call a function multiple times, just with different parameters.

359 points
A8dae06578bc9d92dae1bc04210dbb3b?s=140&d=retro
Submitted by
Adam Hubbs
over 2 years ago