Jump to content

Problem accessing strings within MD Array?


e-nigma

Recommended Posts

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.  :-\

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.