fork(1) download
  1. <?php
  2.  
  3.  
  4. $text = "Дым табачный воздух выел.
  5. Комната —
  6. глава в крученыховском аде.
  7. Вспомни —
  8. за этим окном
  9. впервые
  10. руки твои, исступлённый, гладил.
  11. Сегодня сидишь вот,
  12. сердце в железе.
  13. День ещё —
  14. выгонишь,
  15. может быть, изругав.
  16. В мутной передней долго не влезет
  17. сломанная дрожью рука в рукав.";
  18. $newArray = explode("\n", $text);
  19. $lenArray = array();
  20. foreach ($newArray as $k => $v) {
  21. $lenArray[$k] = strlen($v);
  22. }
  23. $maxLength = max($lenArray);
  24. $emp = '';
  25.  
  26. $words = array();
  27. foreach ($newArray as $numberStr => $str) {
  28. $words[$numberStr] = str_split($str);
  29. }
  30. $c = count($words);
  31. echo $c;
  32. echo "<pre>";
  33. print_r($words);
  34. echo "</pre>";
  35. echo "<table border=\"1\" cellpadding=\"3\" height=\"80%\">";
  36. for ($k = 0; $k < $maxLength - 1; $k++) {
  37. echo "<tr>";
  38. for ($i = 0; $i <= count($words) - 1; $i++) {
  39. if (isset($words[$i][$k])) {
  40.  
  41. $var = $words[$i][$k];
  42.  
  43.  
  44. echo "<td>$var</td>";
  45. } else {
  46. echo "<td>$emp</td>";
  47. }
  48.  
  49.  
  50.  
  51. }
  52. echo "</tr>";
  53.  
  54.  
  55. }
  56.  
  57. echo "</table>";
  58.  
  59.  
  60.  
  61. ?>
  62.  
Success #stdin #stdout 0.04s 20568KB
stdin
Standard input is empty
stdout
14<pre>Array
(
    [0] => Array
        (
            [0] => �
            [1] => �
            [2] => �
            [3] => �
            [4] => �
            [5] => �
            [6] =>  
            [7] => �
            [8] => �
            [9] => �
            [10] => �
            [11] => �
            [12] => �
            [13] => �
            [14] => �
            [15] => �
            [16] => �
            [17] => �
            [18] => �
            [19] => �
            [20] => �
            [21] => �
            [22] => �
            [23] =>  
            [24] => �
            [25] => �
            [26] => �
            [27] => �
            [28] => �
            [29] => �
            [30] => �
            [31] => �
            [32] => �
            [33] => �
            [34] => �
            [35] => �
            [36] =>  
            [37] => �
            [38] => �
            [39] => �
            [40] => �
            [41] => �
            [42] => �
            [43] => �
            [44] => �
            [45] => .
        )

    [1] => Array
        (
            [0] => �
            [1] => �
            [2] => �
            [3] => �
            [4] => �
            [5] => �
            [6] => �
            [7] => �
            [8] => �
            [9] => �
            [10] => �
            [11] => �
            [12] => �
            [13] => �
            [14] =>  
            [15] => �
            [16] => �
            [17] => �
        )

    [2] => Array
        (
            [0] => �
            [1] => �
            [2] => �
            [3] => �
            [4] => �
            [5] => �
            [6] => �
            [7] => �
            [8] => �
            [9] => �
            [10] =>  
            [11] => �
            [12] => �
            [13] =>  
            [14] => �
            [15] => �
            [16] => �
            [17] => �
            [18] => �
            [19] => �
            [20] => �
            [21] => �
            [22] => �
            [23] => �
            [24] => �
            [25] => �
            [26] => �
            [27] => �
            [28] => �
            [29] => �
            [30] => �
            [31] => �
            [32] => �
            [33] => �
            [34] => �
            [35] => �
            [36] => �
            [37] => �
            [38] => �
            [39] => �
            [40] => �
            [41] => �
            [42] =>  
            [43] => �
            [44] => �
            [45] => �
            [46] => �
            [47] => �
            [48] => �
            [49] => .
        )

    [3] => Array
        (
            [0] => �
            [1] => �
            [2] => �
            [3] => �
            [4] => �
            [5] => �
            [6] => �
            [7] => �
            [8] => �
            [9] => �
            [10] => �
            [11] => �
            [12] => �
            [13] => �
            [14] =>  
            [15] => �
            [16] => �
            [17] => �
        )

    [4] => Array
        (
            [0] => �
            [1] => �
            [2] => �
            [3] => �
            [4] =>  
            [5] => �
            [6] => �
            [7] => �
            [8] => �
            [9] => �
            [10] => �
            [11] => �
            [12] => �
            [13] =>  
            [14] => �
            [15] => �
            [16] => �
            [17] => �
            [18] => �
            [19] => �
            [20] => �
            [21] => �
            [22] => �
            [23] => �
        )

    [5] => Array
        (
            [0] => �
            [1] => �
            [2] => �
            [3] => �
            [4] => �
            [5] => �
            [6] => �
            [7] => �
            [8] => �
            [9] => �
            [10] => �
            [11] => �
            [12] => �
            [13] => �
        )

    [6] => Array
        (
            [0] => �
            [1] => �
            [2] => �
            [3] => �
            [4] => �
            [5] => �
            [6] => �
            [7] => �
            [8] =>  
            [9] => �
            [10] => �
            [11] => �
            [12] => �
            [13] => �
            [14] => �
            [15] => �
            [16] => �
            [17] => ,
            [18] =>  
            [19] => �
            [20] => �
            [21] => �
            [22] => �
            [23] => �
            [24] => �
            [25] => �
            [26] => �
            [27] => �
            [28] => �
            [29] => �
            [30] => �
            [31] => �
            [32] => �
            [33] => �
            [34] => �
            [35] => �
            [36] => �
            [37] => �
            [38] => �
            [39] => �
            [40] => �
            [41] => �
            [42] => �
            [43] => ,
            [44] =>  
            [45] => �
            [46] => �
            [47] => �
            [48] => �
            [49] => �
            [50] => �
            [51] => �
            [52] => �
            [53] => �
            [54] => �
            [55] => �
            [56] => �
            [57] => .
        )

    [7] => Array
        (
            [0] => �
            [1] => �
            [2] => �
            [3] => �
            [4] => �
            [5] => �
            [6] => �
            [7] => �
            [8] => �
            [9] => �
            [10] => �
            [11] => �
            [12] => �
            [13] => �
            [14] =>  
            [15] => �
            [16] => �
            [17] => �
            [18] => �
            [19] => �
            [20] => �
            [21] => �
            [22] => �
            [23] => �
            [24] => �
            [25] => �
            [26] => �
            [27] =>  
            [28] => �
            [29] => �
            [30] => �
            [31] => �
            [32] => �
            [33] => �
            [34] => ,
        )

    [8] => Array
        (
            [0] => �
            [1] => �
            [2] => �
            [3] => �
            [4] => �
            [5] => �
            [6] => �
            [7] => �
            [8] => �
            [9] => �
            [10] => �
            [11] => �
            [12] =>  
            [13] => �
            [14] => �
            [15] =>  
            [16] => �
            [17] => �
            [18] => �
            [19] => �
            [20] => �
            [21] => �
            [22] => �
            [23] => �
            [24] => �
            [25] => �
            [26] => �
            [27] => �
            [28] => .
        )

    [9] => Array
        (
            [0] => �
            [1] => �
            [2] => �
            [3] => �
            [4] => �
            [5] => �
            [6] => �
            [7] => �
            [8] =>  
            [9] => �
            [10] => �
            [11] => �
            [12] => �
            [13] => �
            [14] => �
            [15] =>  
            [16] => �
            [17] => �
            [18] => �
        )

    [10] => Array
        (
            [0] => �
            [1] => �
            [2] => �
            [3] => �
            [4] => �
            [5] => �
            [6] => �
            [7] => �
            [8] => �
            [9] => �
            [10] => �
            [11] => �
            [12] => �
            [13] => �
            [14] => �
            [15] => �
            [16] => ,
        )

    [11] => Array
        (
            [0] => �
            [1] => �
            [2] => �
            [3] => �
            [4] => �
            [5] => �
            [6] => �
            [7] => �
            [8] => �
            [9] => �
            [10] =>  
            [11] => �
            [12] => �
            [13] => �
            [14] => �
            [15] => �
            [16] => �
            [17] => �
            [18] => �
            [19] => ,
            [20] =>  
            [21] => �
            [22] => �
            [23] => �
            [24] => �
            [25] => �
            [26] => �
            [27] => �
            [28] => �
            [29] => �
            [30] => �
            [31] => �
            [32] => �
            [33] => �
            [34] => �
            [35] => .
        )

    [12] => Array
        (
            [0] => �
            [1] => �
            [2] =>  
            [3] => �
            [4] => �
            [5] => �
            [6] => �
            [7] => �
            [8] => �
            [9] => �
            [10] => �
            [11] => �
            [12] => �
            [13] => �
            [14] => �
            [15] =>  
            [16] => �
            [17] => �
            [18] => �
            [19] => �
            [20] => �
            [21] => �
            [22] => �
            [23] => �
            [24] => �
            [25] => �
            [26] => �
            [27] => �
            [28] => �
            [29] => �
            [30] => �
            [31] => �
            [32] =>  
            [33] => �
            [34] => �
            [35] => �
            [36] => �
            [37] => �
            [38] => �
            [39] => �
            [40] => �
            [41] => �
            [42] => �
            [43] =>  
            [44] => �
            [45] => �
            [46] => �
            [47] => �
            [48] =>  
            [49] => �
            [50] => �
            [51] => �
            [52] => �
            [53] => �
            [54] => �
            [55] => �
            [56] => �
            [57] => �
            [58] => �
            [59] => �
            [60] => �
        )

    [13] => Array
        (
            [0] => �
            [1] => �
            [2] => �
            [3] => �
            [4] => �
            [5] => �
            [6] => �
            [7] => �
            [8] => �
            [9] => �
            [10] => �
            [11] => �
            [12] => �
            [13] => �
            [14] => �
            [15] => �
            [16] => �
            [17] => �
            [18] =>  
            [19] => �
            [20] => �
            [21] => �
            [22] => �
            [23] => �
            [24] => �
            [25] => �
            [26] => �
            [27] => �
            [28] => �
            [29] => �
            [30] => �
            [31] =>  
            [32] => �
            [33] => �
            [34] => �
            [35] => �
            [36] => �
            [37] => �
            [38] => �
            [39] => �
            [40] =>  
            [41] => �
            [42] => �
            [43] =>  
            [44] => �
            [45] => �
            [46] => �
            [47] => �
            [48] => �
            [49] => �
            [50] => �
            [51] => �
            [52] => �
            [53] => �
            [54] => .
        )

)
</pre><table  border="1" cellpadding="3" height="80%"><tr><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td> </td><td>�</td></tr><tr><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td>�</td><td>�</td><td>�</td><td> </td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td></tr><tr><td> </td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td> </td><td>�</td><td>�</td><td> </td><td>�</td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td>�</td><td> </td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td> </td><td>�</td><td>�</td></tr><tr><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td> </td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td>�</td><td> </td><td>�</td><td> </td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td> </td><td>�</td><td> </td><td>�</td><td></td><td>�</td><td> </td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td></td><td>�</td><td>�</td><td> </td><td> </td><td>�</td><td>�</td><td> </td><td>�</td></tr><tr><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td></td><td>�</td><td>�</td><td>�</td><td>�</td><td>,</td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td>�</td><td>�</td><td>�</td><td>�</td><td></td><td>,</td><td>�</td><td>�</td><td>�</td><td></td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td>�</td><td></td><td> </td><td>�</td><td>�</td><td>�</td><td></td><td>�</td><td>�</td><td> </td></tr><tr><td>�</td><td></td><td>�</td><td></td><td>�</td><td></td><td>�</td><td>�</td><td>�</td><td></td><td></td><td>,</td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td>�</td><td></td><td>�</td><td>�</td><td>�</td><td></td><td></td><td> </td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td>�</td><td></td><td>�</td><td>�</td><td>�</td><td></td><td></td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td>�</td><td></td><td>�</td><td>�</td><td>�</td><td></td><td></td><td>�</td><td>�</td><td>�</td></tr><tr><td> </td><td></td><td>�</td><td></td><td>�</td><td></td><td>�</td><td>�</td><td>�</td><td></td><td></td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td>�</td><td>�</td><td></td><td></td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td>�</td><td>�</td><td></td><td></td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td>�</td><td>�</td><td></td><td></td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td> </td><td>�</td><td></td><td></td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td>�</td><td>.</td><td></td><td></td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td>�</td><td></td><td></td><td></td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td>�</td><td></td><td></td><td></td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td>�</td><td></td><td></td><td></td><td>�</td><td>�</td><td> </td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td>�</td><td></td><td></td><td></td><td>�</td><td> </td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td>�</td><td></td><td></td><td></td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td>,</td><td></td><td></td><td></td><td>�</td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td>.</td><td>�</td><td>�</td></tr><tr><td> </td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td> </td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td> </td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td>�</td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td>,</td><td></td><td></td><td></td><td></td><td></td><td> </td><td> </td></tr><tr><td>�</td><td></td><td>�</td><td></td><td></td><td></td><td> </td><td></td><td></td><td></td><td></td><td></td><td>�</td><td>�</td></tr><tr><td>.</td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td>�</td></tr><tr><td></td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td>�</td></tr><tr><td></td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td>�</td></tr><tr><td></td><td></td><td>�</td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td> </td><td>�</td></tr><tr><td></td><td></td><td>.</td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td>�</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td>�</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td>�</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td>�</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td>�</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td>.</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>�</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>.</td><td></td><td></td><td></td><td></td><td></td><td>�</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>�</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>�</td><td></td></tr></table>