PHP - Convert multidimensional array to 2D array -


I have an array that is multi-dimensional like this

  array (0 = & gt; ; Array ('user' = & gt; array ('email' = & gt; 'test@yahoo.com, testuser @ yahoo.com', 'username' => 'test, testuser', 'description' = & Gt; 'description1, description2')));  

I want to change this array to this form

  $ user = array ('email' = & gt; array ('test @ yahoo Array '(' test ',' tester '),' description '= & gt; array (' description1 ',' description2 ')) ;  

Please need help !!!.

Index for only one:

  $ arrayTwoD = array ); Forex currency ($ valueMult [0] [$ user name]] as $ key = $ {$ array2 double [$ key] = array_push (explosion (',', $ value); }  

If you have multiple indexes in $ multArray :

  $ arrayTwoD = array (); Foreach ($ multArray as $ keyMult = & gt; $ valueMult) {foreach ($ value = '$' as valueMult ['user'] = $ value) {$ array2 double [$ keyMult] [$ key] = array_push ('Explosion,', $ value)); }}  

or

  $ arrayTwoD = array (); Forex currency ($ array as multiples) {foreach ($ array = [$ value] as $ array ['user']) {$ arrayTwoD [$ key] = array_push (explosion (',', $ Value)); }}  

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -