There is an array:
Array ( [title] => Array ( [0] => Mortal Kombat X [1] => Mortal Kombat 2 ) [desc] => Array ( [0] => 489 [1] => 32 ) [metatitle] => Array ( [0] => 34 [1] => 4 ) [date] => Array ( [0] => 17.02.2017 [1] => 17.02.2017 ) [magnet] => Array ( [0] => http://site1 [1] => http://site2 ) [torrent] => Array ( [0] => http://site1 [1] => http://site2 ) ) I need to make a cycle and pull out 1 value with a 0 index, then increment the counter and pass again. I know the for loop, but I can't figure it out with forex. No finite number of elements in the array is known here. Therefore, you need to start from scratch and output until it ends.
The algorithm is as follows: 1 cycle of passage should give the following result:
Mortal Kombat X | 489 | 34 | February 17, 2017 | http: // site1 | http: // site1
Then the counter increases and data under index 1 is drawn.
How to do this? I can not overcome yet that Forech.
foreachnot needed here, it is also possiblefortwo passes.for($i = 0; $i < 2; ++$i) { echo $array['title'][$i] .', ' . $array['desc'][$i] . '<br/>'; }for($i = 0; $i < 2; ++$i) { echo $array['title'][$i] .', ' . $array['desc'][$i] . '<br/>'; }...... if it is not known how many passes should be, then it suffices to take$count = count($array['title']);- Alexey Shimansky