cdoggg94 Posted January 23, 2013 Share Posted January 23, 2013 (edited) I have been googling, and can't really find what I want. Basically I want to know if there is a way to restrict the number of characters I display at any time eg: If I have this in a database: "Lorem ipsum dolor sit amet, magna ac pellentesque tellus in, aliquam amet sapien, vitae nec purus pellentesque ligula sit orci. Praesent netus pellentesque nulla. Donec nec urna in, vel molestie. Sed mus eu ultricies sed, eleifend placerat suspendisse id, cras vivamus quam, velit ac suspendisse nonummy porttitor urna, volutpat dignissim quis. Sed varius nam orci ultrices." I and i only want to display this (just a preview of the full story): "Lorem ipsum dolor sit amet, magna ac pellentesque tellus in, aliquam amet sapien, vitae nec purus pellentesque ligula sit orci." The way I display it on a page would be something like this: <?php echo $row_Display['some_text'] ;?> is there anything I can do for this? In the past when I wanted to do this, I just inserted the text block into two different columns in the db and restricted the char count there. Edited January 23, 2013 by cdoggg94 Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 23, 2013 Share Posted January 23, 2013 substr Quote Link to comment Share on other sites More sharing options...
cdoggg94 Posted January 23, 2013 Author Share Posted January 23, 2013 Thank you ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.