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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.