monkeypaw201 Posted April 23, 2008 Share Posted April 23, 2008 im a bit confused on how functions work.. if i put <?php function example() { echo "hello world"; } and farther along the page i put <?php example() ?> will that output hello world or do i need to put <php echo example() ?> ? Link to comment https://forums.phpfreaks.com/topic/102436-function-structure/ Share on other sites More sharing options...
Spaceman-Spiff Posted April 23, 2008 Share Posted April 23, 2008 If the function already echos, you don't need to do another echo. If the function returns the string, then you need to echo or print it. Link to comment https://forums.phpfreaks.com/topic/102436-function-structure/#findComment-524565 Share on other sites More sharing options...
Northern Flame Posted April 23, 2008 Share Posted April 23, 2008 either of them work.... Link to comment https://forums.phpfreaks.com/topic/102436-function-structure/#findComment-524566 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.