David David - 2 months ago 6
PHP Question

How to retrive some lines from particular row in php

Like its a description column which is long but i want to grab some of lines from it on another page ,

$desc=$result_set['Description'];


which is coming from database i want to echo in a p tag but some of its lines not whole description

Answer

Use Substr Function and specify start and end position

<?php
$start=0;
$end=50;
echo substr($result_set['description'],$start,$end);
?>