Jump to content

[SOLVED] Output Text Area Limit


phpbeginner

Recommended Posts

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

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]);
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.