?
Solved

trimming text fields?

Posted on 2003-10-29
1
Medium Priority
?
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

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

will hopefully do what you want.
0

Featured Post

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to dynamically set the form action using jQuery.
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.
Suggested Courses

765 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