kpetsche20 Posted June 28, 2008 Share Posted June 28, 2008 I want to limit the viewable area on the user end, when displaying articles, so my page doesn't elongate too much. How do I count characters in a variable. Link to comment https://forums.phpfreaks.com/topic/112342-how-to-count-characters-in-a-variable/ Share on other sites More sharing options...
LooieENG Posted June 28, 2008 Share Posted June 28, 2008 <?php echo strlen($var); ?> Link to comment https://forums.phpfreaks.com/topic/112342-how-to-count-characters-in-a-variable/#findComment-576784 Share on other sites More sharing options...
kpetsche20 Posted June 28, 2008 Author Share Posted June 28, 2008 How do i only display a certain number of characters in a variable? Link to comment https://forums.phpfreaks.com/topic/112342-how-to-count-characters-in-a-variable/#findComment-576786 Share on other sites More sharing options...
br0ken Posted June 29, 2008 Share Posted June 29, 2008 $startPos = 0; $endPos = 8; $var = "This is just a simple test to limit variable size."; echo substr($var, $startPos, $endPos); Link to comment https://forums.phpfreaks.com/topic/112342-how-to-count-characters-in-a-variable/#findComment-577359 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.