Page 1 of 1

I wish to limit the number of characters displayed

Posted: Mon Jul 12, 2010 10:14 pm
by htmlcssguru
Script URL: Random text
Version of script: 1.0
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:

I'm using this to display some testimonials as the 'quotes' and it works fine. Problem is that some testimonials are a tad longer than others and i'd like to limit the number of characters that it displays in order to create some consistency in how much space it takes up. What code would I need to put in place in order to limit the number of characters in the display?

Thanks in advance.

Posted: Wed Jul 14, 2010 10:48 am
by Klemen
Open rantex.php in Notepad and just ABOVE line

Code: Select all

/* Output the image according to the selected type */
paste this

Code: Select all

$txt = substr($txt,0,50); 
This code will limit the output to 50 chars (change 50 to the length you need).

Posted: Wed Jul 14, 2010 5:44 pm
by htmlcssguru
Thank you! Did the trick.