multidimensional array in php with oops | learn php step by step

preview_player
Показать описание
A two-dimensional array is an array of array. we can solve it with nested for loop and this video will give you example with oops way.

Checkout and subscribe our new channel for technical news
Рекомендации по теме
Комментарии
Автор

Checkout and subscribe our new channel for technical news

codestepbystep
Автор

How to create multi dimensional array with array variables

$var = array ( array(
array(1, 2, 3, 4),
array(2, 4, 3, 6),
array (7, 5, 3, 2) ),
array(
array(1, 2, 3, 4),
array(2, 4, 3, 6),
array(8, 5, 4, 3) )
);

I want to create the above array with array variables like below
$a = array(1, 2, 3, 4);
$b = array(2, 4, 3, 6);
$var = array ( array(
$a,
$b,
array (7, 5, 3, 2) ),
array(
array(1, 2, 3, 4),
array(2, 4, 3, 6),
array(8, 5, 4, 3) )
);
But it is giving errors
How to implement this ?
Thanks in advance.

babuvanam