| 
                                           
                                        <html> 
                                          <form method=post>text to vertical 
                                          <input type=submit> 
                                          inv x:<input type=checkbox name=invx> 
                                          inv y:<input type=checkbox name=invy> 
                                          <br><textarea cols=75 rows=10 name=str></textarea> 
                                          </form> 
                                          <pre> 
                                          <?php 
                                          if (!$str) exit(); 
                                          $str=trim($str); 
                                          $matrix=array(); 
                                          $vert=0;$hori=0; 
                                          for ($j=0;$j<strlen($str);$j++) { 
if ($str[$j]=="\n" or $str[$j]=="\r") { 
$nl++; //f*ck 
if ($nl<2) $vert++; 
$hori=0; 
continue; 
} 
unset($nl); 
$matrix[$vert][$hori] = $str[$j]; 
$hori++; 
$max_hori=max($max_hori,$hori); 
} 
for ($j=0;$j<$max_hori;$j++) { 
for ($i=0;$i<=$vert;$i++) { 
$iout=$i;$jout=$j; 
if ($invx) $iout=$vert-$i; 
if ($invy) $jout=$max_hori-$j; 
if (!is_null($matrix[$iout][$jout])) { 
print htmlentities(stripslashes($matrix[$iout][$jout])); 
} 
else print ' '; 
} 
print "\n"; 
} 
?> 
</pre> 
</html> 
                                          |