CBG Posted April 7, 2010 Share Posted April 7, 2010 Hi, I have a function with the below code in it and I want to have multiple Return values and am unsure how to do it if ( $one == 'yes') { echo 'One Appear'; } else { echo 'One Does not Appear<br>'; $one_bot = 0; } if ( $two == 'yes') { echo 'Two Appear'; } else { echo 'Two Does not Appear<br>'; $two_bot = 0; } if ( $three == 'yes') { echo 'Three Appear'; } else { echo 'Three Does not Appear<br>'; $three_bot = 0; } Now if I put the below it returns 1 0 (zero) in the browser and not all 3 return $one_bot; return $two_bot; return $three_bot; So it seems to be it not working like that, so should I put it in an array like $list = array($one_bot, $two_bot, $three_bot); return $list; ? If not how should I do it? Link to comment https://forums.phpfreaks.com/topic/197903-multiple-return-values/ Share on other sites More sharing options...
taquitosensei Posted April 7, 2010 Share Posted April 7, 2010 an array would be just fine. Link to comment https://forums.phpfreaks.com/topic/197903-multiple-return-values/#findComment-1038502 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.