Jump to content

Recommended Posts

I have a database entry that's super long (an entire first chapter of a book) and I want to display it on the top left side of a div until it reaches the bottom and then, after it reaches the bottom of the div, have it automatically flow into another separate div. This would occur on paginated pages so I'd need it to continue flowing to the next page then do the same auto flow thing again. Picture a book that reads from left to right and that's basically what I'm trying to do. Is this possible with php? Is this possible period?

<?php

$wordsinfirst = "2";

$string = "one two three four";

$words = explode(" ", $string);

foreach($words as $word) {
if($count < $wordsinfirst) {
  $string1 .= "$word ";
} else {
  $string2 .= "$word ";
}

$count++;
}

echo "<div id=\"first\">$string1</div><div id=\"second\">$string2</div>";

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.