title: how to get first some line from a paragraph
body: <p>I have a paragraph stored in database i want to get only first five line from . it how to do this ?</p>
  
  <p>should i convert first array to srting ? if yes then how to do this ?</p>
  
  <p>if its string than i can do this by</p>
  
  <pre><code>$str='mayank kumar swami mayank kumar swami';
  $var= strlen($str);
  for($i=0;$i&lt;8;$i++){
      echo $str[$i];
  }
  </code></pre>
  
  <ol start="2">
  <li>or how to get only 200 word from the database by sql ?</li>
  </ol>
  
  <p>i know it can be done by css easily shows in Show <a href="https://stackoverflow.com/questions/3964900/show-first-line-of-a-paragraph">first line of a paragraph</a> nut i want to do this by php or sql query</p>
  
  <p>what i doing </p>
  
  <pre><code>$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 "&lt;div class=\"article_div\" &gt;";
                  echo "&lt;h4 id=\"article_heading\"&gt;&lt;img src=\"images/new.png\" alt=\"havent got\" style=\"padding-right:7px;\"&gt;".$row['article_name']."&lt;/h4&gt;";
                  echo"&lt;h5 class=\"article_byline\"&gt;";
                  echo" by";
                  echo"&lt;a href=\"#\"&gt;{$row['authore']}&lt;/a&gt;&lt;/h5&gt;";
                  echo" &lt;div id=\"article_about\"&gt;&lt;p&gt;{$row['content']}&lt;/p&gt;&lt;/div&gt;";
                               //here i want to get only 2000  word from database (content)
  
                  echo "&lt;/div&gt;";
              }
          }
  </code></pre>