Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. <?php
  2.  
  3. require_once 'functions.php';
  4.  
  5.  
  6. //$myfile = fopen("skaiciai.txt", "r");
  7. //while (!feof($myfile)) {
  8. // $data = fgets($myfile);
  9. // $string = preg_replace('/[^0-9]/', '', $data);
  10. // $skc = getNums(str_split($string));
  11. //}
  12. //
  13. //echo "<br>";
  14. //echo "<br>";
  15. //echo "<br>";
  16. //echo "<br>";
  17. //
  18. ////print_r($arr1);
  19. //var_dump();
  20. //
  21. //printNumbers($skc);
  22. //$myfile = fopen("skaiciai.txt", "r");
  23. //$max = 0;
  24. //while (!feof($myfile)) {
  25. // $line = fgets($myfile);
  26. // if ($line !== "\n") {
  27. // $sk = array();
  28. // $sk = explode(" ", $line);
  29. // $max += max($sk);
  30. //
  31. // }
  32. // else {
  33. //
  34. // echo "{$max}<br>";
  35. // $max = 0;
  36. //
  37. //
  38. // }
  39. //
  40. //
  41. //}
  42. //
  43. //echo "{$max}<br>";
  44. //
  45. //
  46. //}
  47. //$myfile = fopen("skaiciai.txt", "r");
  48. ////while (!feof($myfile)) {
  49. // $didza = array();
  50. // $sk = file_get_contents("skaiciai.txt" , "/n");
  51. // print_r($sk);
  52. // foreach($sk as $did){
  53. // $didza[] = explode($did, " ");
  54. // $max = max($didza[]);
  55. // print_r($max);
  56. // }
  57. ////
  58. //echo "<br>";
  59. //echo "<br>";
  60. //echo "<br>";
  61. //echo "<br>";
  62. //
  63. //
  64. //
  65. //}
  66. //function sort($arr) {
  67. // $skc = array();
  68. //
  69. // foreach ($arr as $obj) {
  70. // rsort($skc);
  71. // }
  72. //
  73. // print_r($skc);
  74. //}
  75. //
  76. //fclose($myfile);
  77.  
  78.  
  79. $mas = array(array("city", "Kaunas"), array("city", "Vilnius"),
  80. array("city", "Klaipeda"),
  81. array("city", "Alytus"),
  82. array("city", "Birstonas"),
  83. array("city", "Panevezys"),
  84. );
  85.  
  86. //foreach($mas as $x => $x_value) {
  87. // foreach($mas as $x_value => $x_x_value) {
  88. // echo $x_x_value . "<br>";
  89. //
  90. //}
  91. //}
  92.  
  93. $len = count($mas);
  94. for ($i = 0 ; $i < $len; $i++) {
  95.  
  96. for ($col = 0; $col < $len; $col++){
  97. echo $mas[$i][$col]. "<br>";
  98. }
  99. }
  100.  
  101. //$len = count($mas);
  102. //for ($row = 0; $row < $len; $row++) {
  103. //
  104. // for ($col = 0; $col < 3; $col++) {
  105. // echo "<li>".$mas[$row][$col]."</li>";
  106. // }
  107. //
  108. //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement