Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-18-2005, 08:44 AM
WebProWorld Pro
 

Join Date: Jan 2004
Location: Milton Keynes, UK
Posts: 117
DarrenPWS RepRank 0
Default PHP displaying mysql results

Hi all,

Me again.

I am creating many things, one of which is a webmail system.

What I am trying to achieve is in the inbox, if a message's subject is long, I would like to be able to display it as a shortened version with dots so's that it doesn't shift the table layout.

Eg.

Instead of it diplaying:

RE - Can you send me information on html?

It would display:

RE - Can you sen...

---

Does this make sense?

I appreciate your help.

dD.
Reply With Quote
  #2 (permalink)  
Old 02-18-2005, 01:13 PM
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Cornwall, UK
Posts: 862
speed RepRank 1
Default

$subject = "RE - Can you send me information on html?";

if(strlen($subject) > 19) $subject = substr($subject, 0, 16) . '...';

echo "$subject\n";

Change the numbers to cut the string to the length you want.
__________________
US & UK Web Hosting with hourly backups | Hosting Affiliate Scheme | Web Directory 2 for 1 Offer
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0