Jump to content


Photo

Result Lengh Limit


  • Please log in to reply
1 reply to this topic

#1 mcmuney

mcmuney
  • Members
  • PipPipPip
  • Advanced Member
  • 358 posts

Posted 22 March 2006 - 10:57 PM

How do I limit result length. For example, if the full result is a full paragraph text, how would I only show, for example, on the first 100 characters of the paragraph?

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 22 March 2006 - 11:23 PM

[!--quoteo(post=357429:date=Mar 22 2006, 10:57 PM:name=mcmuney)--][div class=\'quotetop\']QUOTE(mcmuney @ Mar 22 2006, 10:57 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
How do I limit result length. For example, if the full result is a full paragraph text, how would I only show, for example, on the first 100 characters of the paragraph?
[/quote]


$desc = $_POST['desc']; 

$text = substr($desc,0,100); 

echo $text; 



This would show only the first 100 characters.

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users