How to display limited characters?

Posted by om 15 May, 2009

To display limited characters from database or from string there is a ready made function available in php it is called – substr ( string string, int start [, int length])

<?php
$mysite = "phpmind.com";
$string = substr($mysite, 0,7);
echo $string;
?>

Out put will be – phpmind

  • Share/Bookmark
Categories : Easy PHP Tags :

Comments

No comments yet.


Leave a comment

(required)

(required)