whelpton Posted June 29, 2008 Share Posted June 29, 2008 Ok, I am using strings to display email contents, I was wondering if there's any way of making my subject string ($strSubject) only display a certain number of characters, for example 25, so that it dosnt break my table formatting. The code I am using is below. $arrMessage = $objPop3->getParsedHeaders($objPop3->numMsg()-$i); $strDate = $arrMessage['Delivery-date']; $strFrom = $arrMessage['From']; $strReplyTo = $arrMessage['Reply-To']; $strSubject = (strlen($arrMessage['Subject'])<1)?'(No Subject)':$arrMessage['Subject']; Thanks Link to comment https://forums.phpfreaks.com/topic/112448-solved-help-with-strings/ Share on other sites More sharing options...
br0ken Posted June 29, 2008 Share Posted June 29, 2008 $strSubject = substr($arrMessage['Subject'], 0, 25); http://php.net/substr Link to comment https://forums.phpfreaks.com/topic/112448-solved-help-with-strings/#findComment-577308 Share on other sites More sharing options...
whelpton Posted June 29, 2008 Author Share Posted June 29, 2008 Cheers but I dont understand how to put that into the code that I am using already, im a real beginner to php Link to comment https://forums.phpfreaks.com/topic/112448-solved-help-with-strings/#findComment-577314 Share on other sites More sharing options...
whelpton Posted June 29, 2008 Author Share Posted June 29, 2008 Thanks ive got it now actually =) Link to comment https://forums.phpfreaks.com/topic/112448-solved-help-with-strings/#findComment-577319 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.