Jump to content

[SOLVED] How to limit chars?


TD

Recommended Posts

Hi, could please someone tell me, how can i limit the echo chars from database,

example, i have in table a row where is many text written, but i need only to echo first 150 chars.

 


$sql = mysql_query("SELECT * FROM $tab where (val=$vid and $subisa and $subisb and $subisc and $subisd) order by title asc limit $limitvalue, $user_view_limit");
   while($r=mysql_fetch_array($sql)) 
   {  
$title=$r["title"] ;
$text=$r["content"] ;
echo "<h2>$title</h2>";
echo "<br/><h3>$text</h3>";

Link to comment
https://forums.phpfreaks.com/topic/65026-solved-how-to-limit-chars/
Share on other sites

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.