Friday, April 8, 2011

Show some line of content with Read more

Show some lines of huge content with Read more link in php

<?php
$content = "Integer pretium vehicula molestie. Nunc nec enim dui, sit amet auctor mauris. Integer in urna vel magna elementum fermentum. Integer a sem in mi eleifend adipiscing. Pellentesque ultrices egestas adipiscing. Nulla placerat enim at lorem ornare sed cursus mauris fringilla. ";

echo substr(strip_tags($content), 0, 100) . "...     " . "<a href='#'>Read more</a>";
?>

No comments:

Post a Comment