Jump to content

Displaying a single entry in two separate places


Jane04k

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>";

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.