corillo181 Posted June 24, 2007 Share Posted June 24, 2007 i got a functions and it echos out a result, the problme is if i make the functions into a string it still echos out the result at the spot where the string is at.. illustration <?php function name(){ echo 'jay'; } ?> now my problem is when i try to use it. <?php $names=name(); echo $names; ?> the result will be jay jay Link to comment https://forums.phpfreaks.com/topic/56935-solved-return-a-value/ Share on other sites More sharing options...
wildteen88 Posted June 24, 2007 Share Posted June 24, 2007 rather than using echo in the name function use return: function name(){ return 'jay'; } Link to comment https://forums.phpfreaks.com/topic/56935-solved-return-a-value/#findComment-281239 Share on other sites More sharing options...
corillo181 Posted June 24, 2007 Author Share Posted June 24, 2007 thank you. Link to comment https://forums.phpfreaks.com/topic/56935-solved-return-a-value/#findComment-281247 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.