I have a long text ($tekst) and I want to splitt this up in different pages. I've searched the arcive, and found this code, witch is what I need, but it does not work, float is not a recognized function. How can I do this?

I'm a newbie, please be understanding.

$limit = 1000; //your design limit
$tot_len = strlen($tekst);
$iter = float($tot_len/$limit);
$c = 1;
while ($c > $iter) {
$start = ($c-1) * $limit;
if ($iter == $c-1) {
$length = $tot_len % $limit;
} else {
$length = $limit;
}
$page[$c] = substr($tekst,$start,$length);
$c++;
}

    Try putting float in parentheses, e.g. $iter = (float)($tot_len/$limit);

      Thanks, but it still don't work

      $limit = 400;
      $totlen = strlen($tekst);
      $iter = (float)($totlen/$limit);
      $num = 1;
      while ($num > $iter) {
      $start = ($num-1) * $limit;
      if ($iter == $num-1) {
      $length = $totlen % $limit;
      } else {
      $length = $limit;
      }
      $page[$num] = substr($tekst,$start,$length);
      $num++;
      }

        Sorry, my mistace.
        Thanks, it worked..

          Write a Reply...