ballouta Posted April 11, 2009 Share Posted April 11, 2009 Hello I have a long text stored in a database (long paragraph). I want to take a part of it (e.g. first 200 characters) can this be done? Thank you Link to comment https://forums.phpfreaks.com/topic/153633-solved-string-cut/ Share on other sites More sharing options...
mrMarcus Posted April 11, 2009 Share Posted April 11, 2009 yes it can. Link to comment https://forums.phpfreaks.com/topic/153633-solved-string-cut/#findComment-807291 Share on other sites More sharing options...
FMATeam Posted April 11, 2009 Share Posted April 11, 2009 It can You check the string length using strlen(); and cut it to 200 using substr(); Link to comment https://forums.phpfreaks.com/topic/153633-solved-string-cut/#findComment-807293 Share on other sites More sharing options...
ballouta Posted April 11, 2009 Author Share Posted April 11, 2009 Thank you i wrote this but i got an error: <?php $inf = substr($row[description], 0, 200); ?> Link to comment https://forums.phpfreaks.com/topic/153633-solved-string-cut/#findComment-807317 Share on other sites More sharing options...
FMATeam Posted April 11, 2009 Share Posted April 11, 2009 $row['description'] <= how about this? Link to comment https://forums.phpfreaks.com/topic/153633-solved-string-cut/#findComment-807342 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.