Manipulating arrays in php -


I have a file uploading file, there is an option to upload it through URL, what I try to do Whenever a user uploads through the URL, I check my database if a file exists that was uploaded through the same URL, then it will display the download URL directly instead of uploading it again. is.

The data array form sent for the upload script is such as: / P>

  array ([0] => http://i41.tinypic.com/3342r93.jpg [1] = & gt; http://i41.tinypic.com/28cfub7.jpg [2] = & gt; http://i41.tinypic.com/12dsa32.jpg)  
< P> And the array used to output the results is as follows:

  Aare ([0] => Array ([ID] => 43 [name ] = & Gt; 3342r93.jpg [size] => 362750 [descr] = & gt; [password] => [Delete_id] => 75 CE [upload_ID] => 75F45CAE1) [1] ] = & Gt; Array ([ID] => [name] => 28cfub7.jpg [size] => 105544 [descr] => [password] => [D] Elete_id] => D392 [upload_id] => 6676FD881) [2] = & gt; Array ([ID] => 45 [name] => 12dsa32.jpg [size] => 49000 [ Descr] = & gt; [password] => [delete_id] => 54C9 [upload_id] => I now want that if the link has already been uploaded, then I will just add it to the output array But keep it in sequence (if the added link array had output result <2 p> 

then what function did the use of the function to remove the matched url from the input array Should go and order number Or in a function to add it to the output array.

// edited

Yes will talk inappropriate but I want to keep the order:

For example After setting the array it looks like this:

  array ([0] = & gt; http://i41.tinypic.com/3342r93.jpg // [1] deleted [2] = & gt; http://i41.tinypic.com/ 12dsa32.jpg)  

but output array

  will be array ( [0] = & gt; Array ([ID] => 33 [name] => 3342r93.jpg [size] => 362750 [descr] = & gt; [password] => [ Delete_id] = & gt; 75CE [upload_id] => 75F45CAE1) // It will be [1], so how do I get another output I can add [1] and other items after it [2], [3] and similarly ... [1] = & gt; Array ([ID] => 45 [name] = & Gt; 12dsa32.jpg [size] => 49000 [descr] = & gt; [password] => [delete_id] => 54C9 [upload_id] => A58614C01))   
 

Code> $ outrage [2] = $ element;

Where there is another array with Elements ID, Name, Size (etc ...) elements.

To delete from the array:

  not set ($ OutArray [2]);  

You may want to read.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -