tcollie Posted January 7, 2007 Share Posted January 7, 2007 Okay, I've written a function that returns an array (at least I think I've got the correct format for producing my array.) This function is called from a separate page within the site. I need to display my array variables on the page the function is called on to finish processing my script. Here is what I have so far:[code]function loc_bonus($id){$loc_high = 5;$loc_med = 3;$loc_low = 1;//Create Array$bonus = array('loc_high'=>$loc_high,'loc_med'=>$loc_med,'loc_low'=>$loc_low) ;return $bonus; }[/code]Now I want to be able to display $loc_low after calling my function on a separate page.Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 7, 2007 Share Posted January 7, 2007 $arr = loc_bonus($id);$loc_low = $arr['loc_low'];print_r($array) is useful for debugging arrays Quote Link to comment Share on other sites More sharing options...
tcollie Posted January 7, 2007 Author Share Posted January 7, 2007 Not only did that answer this particular question for me, it answered several other questions I had in mind for future issues I foresee with my code. Thanks. Your the best. Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 7, 2007 Share Posted January 7, 2007 No problem. Quote Link to comment 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.