Clinton Posted January 4, 2009 Share Posted January 4, 2009 Lets say that I have a form that has a name and a bio, both of which echo just fine. Well, the bio is hellaciously long and I want to limit the amount of bio that is shown (they can click on the name to view the whole bio). What is the best way to do this? Currently I am using tables but from what I understand the <td> attribute will expand to the content inside regardless of size limitations. Link to comment https://forums.phpfreaks.com/topic/139387-solved-not-sure-how-to-limit-data/ Share on other sites More sharing options...
DarkWater Posted January 4, 2009 Share Posted January 4, 2009 Well, it's not too complicated actually. Let's say $bio is your bio: <?php if (strlen($bio) > 200) { $bio = substr($bio, 197) . '...'; } Link to comment https://forums.phpfreaks.com/topic/139387-solved-not-sure-how-to-limit-data/#findComment-729058 Share on other sites More sharing options...
Clinton Posted January 4, 2009 Author Share Posted January 4, 2009 Awesome. Thank you. Link to comment https://forums.phpfreaks.com/topic/139387-solved-not-sure-how-to-limit-data/#findComment-729063 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.