This question already has an answer here:
- Get first n characters of a string 18 answers
I saw this post which had my ans: MySQL Select Query - Get only first 10 characters of a value How to do the same using php ?
</div>
This question already has an answer here:
I saw this post which had my ans: MySQL Select Query - Get only first 10 characters of a value How to do the same using php ?
</div>
This can be done by substr function. Following is the working example with code.
http://sugunan.net/demo/substr.php
<?php
$full_str = "Hello, this is my subject and how are you";
$firstn = substr ( $full_str , 0 ,10 );
echo $firstn;
?>