MDanz Posted September 7, 2011 Share Posted September 7, 2011 i get this error Warning: current() [function.current]: Passed variable is not an array or object.. for this $lastblock = current( ${"s".$row} ); print_r($lastblock); when i change to this it works.. $lastblock = current( $s0 ); print_r($lastblock); The problem is i won't know the $row seeing as it is in a while loop. Solution? Link to comment https://forums.phpfreaks.com/topic/246613-array-error-warning-current-functioncurrent-passed-variable-is-not/ Share on other sites More sharing options...
trq Posted September 7, 2011 Share Posted September 7, 2011 Can we see the code in a little more context? Variable variables are notoriously slow and should be avoided IMO. Link to comment https://forums.phpfreaks.com/topic/246613-array-error-warning-current-functioncurrent-passed-variable-is-not/#findComment-1266368 Share on other sites More sharing options...
ManiacDan Posted September 7, 2011 Share Posted September 7, 2011 I'd have to agree, you're almost certainly doing it wrong, but we need to know more about the rest of this script. -Dan Link to comment https://forums.phpfreaks.com/topic/246613-array-error-warning-current-functioncurrent-passed-variable-is-not/#findComment-1266418 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.