iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar 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.

Share Thread: & Tags

Share Thread:

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: 115
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: 972
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.
Reply With Quote
Reply

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

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

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



All times are GMT -4. The time now is 08:27 PM.



Search Engine Optimization by vBSEO 3.3.0