Cleaning up a PHP array to make it 0 based again -


I sometimes place data in an array that goes away in the array, for example instead of 0, to position 25 .

Example:

  Array ([16] => Array ([0] => http://rapidshare.com/files/268123830/hmh .fo3-Oks.part01.rar [1] = & gt; marked as invalid) [17] = & gt; Array ([0] = & gt; http://rapidshare.com/files/268124204/hmh Fo3-oks.part02.rar [1] = & gt; Illegally marked) [18] = & gt; Array ([0] => http://rapidshare.com/files/268127882/hmh.fo3 -oks.part03.rar [1] = & gt; marked as invalid))  

This is due to user input, I do not have coding for me to clean the array One way is to somehow be 0 based again to make it. The above example should be done after cleaning:

  array ([0] = & gt; Hey ([0] => http://rapidshare.com/files/268123830 / Hmh .fo3-oks.part01.rar [1] = & gt; marked as invalid) [1] = & gt; Array ([0] => http://rapidshare.com/files/268124204/ Hmh.fo3-oks Part02.rar [1] = & gt; marked as invalid) [2] = & gt; Array ([0] = & gt; http://rapidshare.com/files/268127882/hmh Fo3-oks.part03.rar [1] = & gt; marked as invalid))  

So I can effectively loop each array element and output it to the user Can i

This array will be useful, thanks :)

Use relative to item By preserving the sequence, it abandons all the keys and returns a zero-based array.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -