Jump to content

Help limiting text output


lingo5

Recommended Posts

Hi, I´m trying to limit the amount of text outputed from DB to a few lines only.

This is how I display the record

<?php echo $row_novedades_RS['novedades_descripcion_esp']; ?>

and this is a function to limit text output

function limit_text($data,$length)         {
                if($length >= strlen($data)) return $data;
                else return substr($data,0,$length);

        }

I have tried everythin, but I can't figure out how to apply this function to my text so that I can limit the amount of it.

Please help.

Link to comment
https://forums.phpfreaks.com/topic/237726-help-limiting-text-output/
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.