Solved

trimming text fields?

Posted on 2003-10-29
1
216 Views
Last Modified: 2008-03-06
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

0
Comment
Question by:gabss
1 Comment
 
LVL 5

Accepted Solution

by:
LornaJane earned 26 total points
ID: 9642246
<?php echo (substr($row_cat['Desc'],0,50)); ?>

will hopefully do what you want.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question