edwardtilbury Posted April 8, 2009 Share Posted April 8, 2009 I'm trying to remember how to chop off everything that is over 70 characters in a variable... I'm trying to make my xml file compatible with google base.. and my descriptions cannot be over 70 characters.. there's a function that does this.. I just can't remember what is it.. I know in visual basic It's something like that. Thanks! (I'm a php noob, so forgive me if this is totally obvious, I looked, I didn't see it, or a clear example of how to accomplish this.) Quote Link to comment https://forums.phpfreaks.com/topic/153234-solved-chop-off-everything-70-characters-from-string-rtrim-forgot-function-noob/ Share on other sites More sharing options...
edwardtilbury Posted April 8, 2009 Author Share Posted April 8, 2009 I solved my own question... Here it is.. substr($description, 0, 70); See example #3 http://us3.php.net/manual/en/function.substr.php Quote Link to comment https://forums.phpfreaks.com/topic/153234-solved-chop-off-everything-70-characters-from-string-rtrim-forgot-function-noob/#findComment-804979 Share on other sites More sharing options...
Maq Posted April 9, 2009 Share Posted April 9, 2009 Excellent, please mark as [sOLVED] so people know. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/153234-solved-chop-off-everything-70-characters-from-string-rtrim-forgot-function-noob/#findComment-805075 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.