Solved

trimming text fields?

Posted on 2003-10-29
1
217 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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 …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

830 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