This article to share the content of PHP in the knowledge of the array, the need for friends can refer to
Array what's not very simple
int a[1100000]
But that's not what PHP is.
<?php $n =1; $a =array (array ()); $s =array (); $s [1]= "S30408"; $a [1][1][1]=0; $a [1][1][2]=1.05; $a [1][2][1]=0; $a [1][2][2]=2.04; $a [1][3][1]=7.90; $a [1][3][2]=11.15; $a [1][4][1]=17.80; $a [1][4][2]=20.20; $a [1][5][1]=0; $a [1][5][2]=0.09; $a [1][6][1]=0; $a [1][6][2]=0.055; $a [1][7][1]=0; $a [1][7][2]=0.035;? >
This is a three-dimensional array, isn't it some trouble?
Let's talk about one-dimensional arrays.
<?php $s =array ();/* Each array is a dimension */ $s [1]=100; $s [2]=200; Echo $s [1]+ $s [2];? >
This is the array. I have a full array of PHP
<?php $v =array (); $a =array (); function Dfs ($k) { Global $v, $a, $n; if ($k = = $n + 1) {for ($i =1; $i <n; $i + +) { echo $v [$i], ""; } echo $v [$n], "<br>"; } else{for ($i =1; $i <=n; $i + +) { if ($v [$i]==true) { $v [$i]=false; $a [$k]= $i; DFS ($k + 1); $v [$i]=true; }}} DFS (5);? >
This is the full array of 5.
It seems a bit wrong, but not afraid.
Just look at the examples.
The two-dimensional connection is simple.
It is
$s =array (array ());
That's it.
What about tomorrow's chapter?
Let's talk about some arithmetic loops.
Array what's not very simple
int a[1100000]
But that's not what PHP is.
<?php $n =1; $a =array (array ()); $s =array (); $s [1]= "S30408"; $a [1][1][1]=0; $a [1][1][2]=1.05; $a [1][2][1]=0; $a [1][2][2]=2.04; $a [1][3][1]=7.90; $a [1][3][2]=11.15; $a [1][4][1]=17.80; $a [1][4][2]=20.20; $a [1][5][1]=0; $a [1][5][2]=0.09; $a [1][6][1]=0; $a [1][6][2]=0.055; $a [1][7][1]=0; $a [1][7][2]=0.035;? >
This is a three-dimensional array, isn't it some trouble?
Let's talk about one-dimensional arrays.
<?php $s =array ();/* Each array is a dimension */ $s [1]=100; $s [2]=200; Echo $s [1]+ $s [2];? >
This is the array. I have a full array of PHP
<?php $v =array (); $a =array (); function Dfs ($k) { Global $v, $a, $n; if ($k = = $n + 1) {for ($i =1; $i <n; $i + +) { echo $v [$i], ""; } echo $v [$n], "<br>"; } else{for ($i =1; $i <=n; $i + +) { if ($v [$i]==true) { $v [$i]=false; $a [$k]= $i; DFS ($k + 1); $v [$i]=true; }}} DFS (5);? >
This is the full array of 5.
It seems a bit wrong, but not afraid.
Just look at the examples.
The two-dimensional connection is simple.
It is
$s =array (array ());
That's it.
What about tomorrow's chapter?
Let's talk about some arithmetic loops.