Title:
$i =[number];
Print the following graphic:
1 2 3 4
12 13 14 5
11 16 15 6
10 9 8 7
- /**
- * Two-dimensional array sorting
- * @param array $array
- */
- function sort_recursive (&$array) {
- foreach ( $array as $key=+$edge) {
- Ksort ($edge, True);
- $array [$key]= $edge ;
- }
- Ksort ($array, True);
- }
-
- /**
- * Generate a ring of ring numbers
- * @param array $cotainer Two-dimensional arrays containing the generated loops
- * @param int $start _value The starting value of the circle
- * @param int $x The offset value of the circle
- * @param int $grids _edge number of each edge
- */
- function Generate (&$container,$start _value,$x , $grids _edge ){
- $rec _times = Ceil ($grids _edge/2);
- $center = $grids _edge &1?false: $start _value +4* $rec _times * ($rec _times+ 1);
- if ($center) {
- $index = $x + Ceil ($grids _edge/2);
- $container [$index][$index]= $center ;
- }
- for ($i=0; $i < $grids _edge ; $i ++) {
- $right = $x + $grids _edge ;
- $basevalue = $start _value + $i ;
- $container [$x] [$x+$i]= $base _value ;
- $container [$x+$i] [$right]= $grids _edge + $base _value ;
- $container [$right] [$right-$i]= $grids _edge *2+ $base _value ;
- $container [$right-$i] [$x]= $grids _edge *3+ $base _value ;
- }
- }
-
-
- $container = Array ();
- $data = Array (
- 1 = Array (1,6),
- 25=> Array (2,4),
- 41=> Array (3,2),
- );
- /*
- $data =array (
- 1 =>array (+),
- );
- $data =array (
- 1&
http://www.bkjia.com/PHPjc/486031.html www.bkjia.com true http://www.bkjia.com/PHPjc/486031.html techarticle title: $i =[number]; print the following graphic: 1 2 3 4 12 13 14 5 11 16 15 6 10 9 8 7/** * Two-dimensional array sorting * @paramarray $array */function Sort_recur Sive ($array) {foreach ($array ...
-