Hi, everyone Im trying to create something similar to
[URL=”http://www.thefirstpost.co.uk/?storyID=24048″]http://www.thefirstpost.co.uk/?storyID=24048
where the news article will be extracted from the database and the half the content is stored in one div and the other half in another. Now Ive created the following test:
[code=php]<?php
$sql=”select article from article WHERE articleID=’189′”;
$result=mysql_query($sql) or die (“Error!! BAD SELECT SEARCH STATEMENT!!”);
$nrows = mysql_num_rows($result);
$row = mysql_fetch_array($result);
extract($row);
$stringlength = strlen($article);
$remainder = $stringlength % 2;
if ($remainder > 0) {
$p = $stringlength / 2;
$p = $p + 0.5;
echo”<br/><br/>$p”;
}
else {
$p = $stringlength /2;
}
$par1 = substr($article, 0, $p);
echo”<br/><br/><div style=’width:300px;border:1px solid black;align:left’><p align=’justify’>$par1</p></div>”;
$par2 = substr($article, $p);
echo”<br/><br/><div style=’width:300px;border:1px solid black;align:justify’>$par2</div>”;
?>
Now please excuse the above code it is just an example il change the variables etc later. Now my problem is Im wondering if there is a way the first paragraph actually finishes with a word pushed right up to the right alignment in the way the First Post does. At the moment the split occurs and there is a rather large space between the last word in the paragraph and the right border of the div. Hope this makes sense hopefully the following link will help you out. This is how its displayed
[URL=”http://www.emeritus-consultants.co.uk/clickliverpool/admin2/test.php”]Test