trimming text fields?

hi all,

Iam using the following to show descriptions....>

<?php echo ($row_cat['Desc']); ?>


How evers i wish to limit it to 50 charcter....

been looking at chop but that seems the wrong method to me...

Thanks in advance

G

LVL 1
gabssAsked:
Who is Participating?
 
LornaJaneConnect With a Mentor Commented:
<?php echo (substr($row_cat['Desc'],0,50)); ?>

will hopefully do what you want.
0
All Courses

From novice to tech pro — start learning today.