Question and answer is powered by AnsPress.io
I am still using PHP programming language for my web development. I want to fetch data from the database and print a page. This work is done but I want to show some content from all content. How can I do it, I need help.
You will be happy to know that the substr() function used to cut a part of a string from a string, starting at a specified position.
You want to print a sentence using substr in PHP, Follow this code:
<?php echo substr($data->description, 0,100); ?>
This code print the 100 character.