I have a paragraph stored in database i want to get only first five line from . it how to do this ?
should i convert first array to srting ? if yes then how to do this ?
if its string than i can do this by
$str='mayank kumar swami mayank kumar swami';
$var= strlen($str);
for($i=0;$i<8;$i++){
echo $str[$i];
}
- or how to get only 200 word from the database by sql ?
i know it can be done by css easily shows in Show first line of a paragraph nut i want to do this by php or sql query
what i doing
$article_result = mysql_query("SELECT * FROM article ORDER BY time DESC LIMIT 1",$connection);
if($article_result){
while($row = mysql_fetch_array($article_result))
{
echo "<div class=\"article_div\" >";
echo "<h4 id=\"article_heading\"><img src=\"images/new.png\" alt=\"havent got\" style=\"padding-right:7px;\">".$row['article_name']."</h4>";
echo"<h5 class=\"article_byline\">";
echo" by";
echo"<a href=\"#\">{$row['authore']}</a></h5>";
echo" <div id=\"article_about\"><p>{$row['content']}</p></div>";
//here i want to get only 2000 word from database (content)
echo "</div>";
}
}