<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MaggsWeb:7 &#187; abbr</title>
	<atom:link href="http://www.maggsweb.com/tag/abbr/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maggsweb.com</link>
	<description>www.maggsweb.com</description>
	<lastBuildDate>Sat, 21 Aug 2010 20:50:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>trimtext with display</title>
		<link>http://www.maggsweb.com/php/trimtext-wit-display/</link>
		<comments>http://www.maggsweb.com/php/trimtext-wit-display/#comments</comments>
		<pubDate>Mon, 23 Jul 2007 20:47:39 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[abbr]]></category>
		<category><![CDATA[function]]></category>

		<guid isPermaLink="false">http://www.cmaggs.co.uk/?p=12</guid>
		<description><![CDATA[Text too long&#8230;? Not wrapping, or pushing other elements around&#8230;? I wrote this little function to trim text to any length, adding &#8216;&#8230;&#8217; at the end if trimmed. Then, it displays the full text as you hover over it. Cooool! ?View Code PHP&#60;?php function trimtext &#40;$text,$max&#41; &#123; if &#40;strlen&#40;$text&#41; &#60;= $max&#41; &#123; return $text; &#125; [...]]]></description>
			<content:encoded><![CDATA[<p>Text too long&#8230;?   Not wrapping, or pushing other elements around&#8230;?  I wrote this little function to trim text to any length, adding &#8216;&#8230;&#8217; at the end if trimmed.  Then, it displays the full text as you hover over it.  Cooool!</p>
<p><span id="more-12"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p12code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p122"><td class="code" id="p12code2"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> trimtext <span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span><span style="color: #000088;">$max</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/strlen" onclick="pageTracker._trackPageview('/outgoing/www.php.net/strlen?referer=');"><span style="color: #990000;">strlen</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$max</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$text</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000088;">$text2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;abbr title=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$text</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$text2</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/substr" onclick="pageTracker._trackPageview('/outgoing/www.php.net/substr?referer=');"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$max</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$text2</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;...&lt;/abbr&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$text2</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'123456789'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> trimtext<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Displays:  <abbr title="123456789">123..</abbr> (Hover over for full text)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/php/trimtext-wit-display/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
