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? 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. 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')); ?> Link to comment https://forums.phpfreaks.com/topic/203356-return-array/#findComment-1065363 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.