corillo181 Posted September 27, 2007 Share Posted September 27, 2007 i got a function function something($we){ while($we){ return $we; } } but this does not work. and echo would mess up my code because there is a lot of headers involve. Quote Link to comment https://forums.phpfreaks.com/topic/70820-using-return-on-a-loop/ Share on other sites More sharing options...
teng84 Posted September 27, 2007 Share Posted September 27, 2007 i guess your on the wrong practice using return you should not put it inside the loop once the loop run and see the return it will terminate the loop as well as the function and return the first data it saw Quote Link to comment https://forums.phpfreaks.com/topic/70820-using-return-on-a-loop/#findComment-356067 Share on other sites More sharing options...
corillo181 Posted September 27, 2007 Author Share Posted September 27, 2007 i know, but my question is what can i do to make a while look give me all it's result in a return. something like putting the result sin a array.. i just need a lead to fallow. Quote Link to comment https://forums.phpfreaks.com/topic/70820-using-return-on-a-loop/#findComment-356076 Share on other sites More sharing options...
teng84 Posted September 27, 2007 Share Posted September 27, 2007 function something($we){ while(ect......){ $array[] = $value; } return $array; } Quote Link to comment https://forums.phpfreaks.com/topic/70820-using-return-on-a-loop/#findComment-356078 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.