e-nigma Posted May 28, 2012 Share Posted May 28, 2012 Hi everyone, I wondering if anyone can help with the following problem. I had been gaining accessing to multidimensional arrays just fine through one specific route of logic but now there seems to be a problem. I was thinking I might need to add another condition to for loop and have it be multiple condition based. Anyhow the for loop isn't iterating in this distinct case. I need to gain access to every numerically indexed array of $imgs_data['src_imgs'] hence $imgs_data['src_imgs'][0] and $imgs_data['src_imgs'][1] etc. which is dependent on how many files had been uploaded by users. So each array index is the key being assigned to a value and the value is a string which is actually a full path to a file and this is the case with each instance. However I don't believe $vars[] below will work because I just need each string returned through iteration but not the strings stored in an array, because I need to pass each string from the MD associative array to other functions for image processing. A very simple example of what I've tested and I have tested many other alternate methods besides the following too: (the function below is from a custom library to extension within my CI framework) function imgs_process_gd($imgs_data = array(array())) { $CI =& get_instance(); ini_set('memory_limit', '96M'); for($i = 0; $i < count($imgs_data['src_imgs'][$i]); $i++): return $vars[] = $imgs_data['src_imgs'][$i]; endfor; } Any help please, thanks. :-\ Link to comment https://forums.phpfreaks.com/topic/263255-problem-accessing-strings-within-md-array/ Share on other sites More sharing options...
Barand Posted May 28, 2012 Share Posted May 28, 2012 for($i = 0; $i < count($imgs_data['src_imgs']); $i++): Link to comment https://forums.phpfreaks.com/topic/263255-problem-accessing-strings-within-md-array/#findComment-1349187 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.