fazzfarrell Posted October 14, 2007 Share Posted October 14, 2007 I have this: <div class="AccordionPanelTab"><?php echo chop($row_rsNewsItems['Title']); ?></div> and I want to trim the length of the title so it is only 100 chareters wide, where do I start? Link to comment https://forums.phpfreaks.com/topic/73207-solved-trim-by-lenghth/ Share on other sites More sharing options...
GingerRobot Posted October 14, 2007 Share Posted October 14, 2007 Try the substr() function. Link to comment https://forums.phpfreaks.com/topic/73207-solved-trim-by-lenghth/#findComment-369295 Share on other sites More sharing options...
fazzfarrell Posted October 14, 2007 Author Share Posted October 14, 2007 i tried this thanks <div class="AccordionPanelTab"><?php echo substr('$row_rsNewsItems['Title']', 1); ?></div> and I get an error Parse error: syntax error, unexpected T_STRING? Link to comment https://forums.phpfreaks.com/topic/73207-solved-trim-by-lenghth/#findComment-369297 Share on other sites More sharing options...
trq Posted October 14, 2007 Share Posted October 14, 2007 <div class="AccordionPanelTab"><?php echo substr($row_rsNewsItems['Title'],0, 100); ?></div> Link to comment https://forums.phpfreaks.com/topic/73207-solved-trim-by-lenghth/#findComment-369302 Share on other sites More sharing options...
fazzfarrell Posted October 14, 2007 Author Share Posted October 14, 2007 got it thanks, got it perfect by doing this <div class="AccordionPanelTab"><?php echo substr($row_rsNewsItems['Title'], 0, 34); ?>...</div> thanks Link to comment https://forums.phpfreaks.com/topic/73207-solved-trim-by-lenghth/#findComment-369303 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.