phpbeginner Posted June 26, 2007 Share Posted June 26, 2007 I have read this somewhere but can't find it and I know it's simple for most of you but how do I output a specific number of characters from blob. I have a frontpage block which will be linking to the full blob, but I only want to have maybe 90 or so characters from the blob in my frontpage block. Link to comment https://forums.phpfreaks.com/topic/57180-solved-output-text-area-limit/ Share on other sites More sharing options...
trq Posted June 26, 2007 Share Posted June 26, 2007 substr(). Link to comment https://forums.phpfreaks.com/topic/57180-solved-output-text-area-limit/#findComment-282526 Share on other sites More sharing options...
marcus Posted June 26, 2007 Share Posted June 26, 2007 You can use substr <?php //say you have a sql query already and $row = mysql_fetch_assoc($res) $body = substr($row[body],0,90); //the 1st character to the 90th character echo $body; //to find character length of the blob use: echo strlen($row[body]); ?> Link to comment https://forums.phpfreaks.com/topic/57180-solved-output-text-area-limit/#findComment-282528 Share on other sites More sharing options...
phpbeginner Posted June 26, 2007 Author Share Posted June 26, 2007 Yep, too easy. Thanks a bunch ! Link to comment https://forums.phpfreaks.com/topic/57180-solved-output-text-area-limit/#findComment-282552 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.