How to breakdown an array multidimension in PHP


Ask A Question





Login To post a question

I have a problem in detailing array numbers as below

array (size=3)
  0 => 
    array (size=2)
      'um' => float 1000
      'kali' => string '2' (length=1)
  1 => 
    array (size=2)
      'um' => float 2000
      'kali' => string '5' (length=2)
  2 => 
    array (size=2)
      'um' => float 5000
      'kali' => string '1' (length=1)

What should i do if the end result is as follows

array (size=7)
  0 => 
    array (size=2)
      'um' => float 1000
      'kali' => string '1' (length=1)
  1 => 
    array (size=2)
      'um' => float 1000
      'kali' => string '2' (length=1)
  2 => 
    array (size=2)
      'um' => float 2000
      'kali' => string '3' (length=1)
  3 => 
    array (size=2)
      'um' => float 2000
      'kali' => string '4' (length=1)
  4 => 
    array (size=2)
      'um' => float 2000
      'kali' => string '5' (length=1)
  5 => 
    array (size=2)
      'um' => float 2000
      'kali' => string '6' (length=1)
  6 => 
    array (size=2)
      'um' => float 5000
      'kali' => string '7' (length=1)

String ['kali'] loop as much as the previous array

for example:
['kali'] = 2 looping 2 times
['kali'] = 5 looping 5 times
etc..

Please enlighten this case

For more info please click herehttps://stackoverflow.com/q/56616843



Have a question or need a custom quote?
info@smartinfocare.com