jwk811 Posted May 30, 2010 Share Posted May 30, 2010 how can i get the values im trying this this in the function: return array("currentTrophy"=>$trophy, "currentRows"=>$rows, "nextTrophy"=>$nextTrophy, "rowsNeeded"=>$rowsNeeded); and this when i call it later <?php list ($currentTrophy, $currentRows, $nextTrophy, $rowsNeeded) = getTrophy($id, 'Posts', 'account'); ?> then each variable there. what am i doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/203356-return-array/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 30, 2010 Share Posted May 30, 2010 Note: list() only works on numerical arrays and assumes the numerical indices start at 0. Quote Link to comment https://forums.phpfreaks.com/topic/203356-return-array/#findComment-1065362 Share on other sites More sharing options...
shino Posted May 30, 2010 Share Posted May 30, 2010 You could do <?php extract(getTrophy($id, 'Posts', 'account')); ?> Quote Link to comment https://forums.phpfreaks.com/topic/203356-return-array/#findComment-1065363 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.