# Text-columns. What is wrong with my code?

**URL:** <https://forum.kirupa.com/t/text-columns-what-is-wrong-with-my-code/128097>\
**Category:** Uncategorized\
**Created:** [November 9, 2004, 4:07pm UTC](https://forum.kirupa.com/t/text-columns-what-is-wrong-with-my-code/128097 "2004-11-09T16:07:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![superduper](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@superduper](https://forum.kirupa.com/u/superduper)\
**Post date:** [November 9, 2004, 4:07pm UTC](https://forum.kirupa.com/t/text-columns-what-is-wrong-with-my-code/128097/1 "2004-11-09T16:07:14Z")

</div>

Check this out!!

```auto

<?
$col_size = 1600;
$line_length = 35;
$text=" text goes here ", ($text);
$num_text = strlen($text);
$num_cols = $num_text / $col_size;
if($_GET['s'] == "")
{
$start = 0;
}
else
{
$start = $_GET['s'];
}
$bstart = $start - $col_size - $col_size - 1;
for ($i = 0; $i < 2; $i++)
{
$q = 1;
$text_array[$i] = substr($text, $start, $col_size);
while(substr($text_array[$i], -1) != " ")
{
$text_array[$i] = substr($text, $start, $col_size + $q);
$q++;
}
$start = $start + strlen($text_array[$i]);
}
$max = count($text_array);
print "<table cellspacing='0' cellpadding='0' border='0' width='468'><tr>";
print "<td width='224' valign='top'>" . $text_array[0] . "</td>";
print "<td width='20'></td>";
print "<td width='224' valign='top'>" . $text_array[1] . "</td>";
print "</tr></table>";
 
if($bstart < 0)
{}else{
?>
<a href="?page=art&amp;s=<? print $bstart; ?>">Previous</a>
<?
}
if($start >= $num_text)
{}else{
?>
<a href="?page=art&amp;s=<? print $start; ?>">Next</a>
<?
}
?>
 

```

Me and me buddy have been making this awsome code to distibute text to columns, but there is something wrong here… I have no clue what that is:cyclops: cause I’m a real rookie. So… I was wondering: Can u guys help me? I think the error is somewhere around the $text-stuff in the top.

Pardon my bad english:disco: It would be great if u could help me!
