<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Commenti a: Very short snippet: PHP word cut</title>
	<atom:link href="http://www.undolog.com/2008/09/21/very-short-snippet-php-word-cut/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.undolog.com/2008/09/21/very-short-snippet-php-word-cut/</link>
	<description>Research &#38; Development  Blog</description>
	<lastBuildDate>Thu, 02 Feb 2012 21:54:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>Di: Undolog.com» Very short snippet: PHP, tagliare a parole, contanto i caratteri</title>
		<link>http://www.undolog.com/2008/09/21/very-short-snippet-php-word-cut/#comment-2447</link>
		<dc:creator>Undolog.com» Very short snippet: PHP, tagliare a parole, contanto i caratteri</dc:creator>
		<pubDate>Sat, 12 Sep 2009 22:36:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.undolog.com/?p=677#comment-2447</guid>
		<description>[...] già visto in Very short snippet: PHP word cut è più gradevole spezzare un testo a &quot;parole&quot;, in quanto si evita di tagliare una parola. C&#039;è [...]</description>
		<content:encoded><![CDATA[<p>[...] già visto in Very short snippet: PHP word cut è più gradevole spezzare un testo a &quot;parole&quot;, in quanto si evita di tagliare una parola. C&#39;è [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Di: Badoux C.</title>
		<link>http://www.undolog.com/2008/09/21/very-short-snippet-php-word-cut/#comment-1183</link>
		<dc:creator>Badoux C.</dc:creator>
		<pubDate>Tue, 07 Oct 2008 17:03:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.undolog.com/?p=677#comment-1183</guid>
		<description>Je n&#039;en dirai pas plus:

http://fr.php.net/manual/fr/function.substr.php

et pour finir un exemple:

http://www.destrucsaweb.com/ressources/phpmyannu/goto_38.php

A+</description>
		<content:encoded><![CDATA[<p>Je n&#8217;en dirai pas plus:</p>
<p><a href="http://fr.php.net/manual/fr/function.substr.php" rel="nofollow">http://fr.php.net/manual/fr/function.substr.php</a></p>
<p>et pour finir un exemple:</p>
<p><a href="http://www.destrucsaweb.com/ressources/phpmyannu/goto_38.php" rel="nofollow">http://www.destrucsaweb.com/ressources/phpmyannu/goto_38.php</a></p>
<p>A+</p>
]]></content:encoded>
	</item>
	<item>
		<title>Di: Giovambattista Fazioli</title>
		<link>http://www.undolog.com/2008/09/21/very-short-snippet-php-word-cut/#comment-1140</link>
		<dc:creator>Giovambattista Fazioli</dc:creator>
		<pubDate>Mon, 22 Sep 2008 12:32:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.undolog.com/?p=677#comment-1140</guid>
		<description>@Giulio: prego caro! Anche se nessuno si è accorto che per grandi stringhe la funzione corretta sarebbe:
[cc_php]
function wordCut($c, $l){
    $a= explode(&#039; &#039;,$c);
    if( count($a) &gt; $l) {
        for($i=0; $i&lt;$l; $i++) $r[$i] = $a[$i];
        $r= implode(&#039; &#039;, $r).&#039;...&#039;;
        return $r;
    } else return $c;
}
[/cc_php]
:P</description>
		<content:encoded><![CDATA[<p>@Giulio: prego caro! Anche se nessuno si è accorto che per grandi stringhe la funzione corretta sarebbe:</p>
<div class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> wordCut<span style="color: #009900;">&#40;</span><span style="color: #000088;">$c</span><span style="color: #339933;">,</span> <span style="color: #000088;">$l</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$a</span><span style="color: #339933;">=</span> <a href="http://www.php.net/explode"><span style="color: #990000;">explode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$l</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$l</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$r</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$r</span><span style="color: #339933;">=</span> <a href="http://www.php.net/implode"><span style="color: #990000;">implode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$r</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'...'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$r</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$c</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p> <img src='http://www.undolog.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Di: Giovambattista Fazioli</title>
		<link>http://www.undolog.com/2008/09/21/very-short-snippet-php-word-cut/#comment-1139</link>
		<dc:creator>Giovambattista Fazioli</dc:creator>
		<pubDate>Mon, 22 Sep 2008 12:29:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.undolog.com/?p=677#comment-1139</guid>
		<description>@Napolux: ho cercato invano la tua funzione sul tuo blog... cmq anche così andrebbe bene:
[cc_php]
function wordCut($c, $l){
    $c = explode(&#039; &#039;,$c);
    for($i=0; $i&lt;$l; $i++) $r[$i] = ($i==0)?$c[$i]:(&#039; &#039;.$c[$i]);
    return ($r.&#039;...&#039;);
}
[/cc_php]
Nota la &quot;chicca&quot; per non preoccuparsi di eliminare lo spazio in più :)</description>
		<content:encoded><![CDATA[<p>@Napolux: ho cercato invano la tua funzione sul tuo blog&#8230; cmq anche così andrebbe bene:</p>
<div class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> wordCut<span style="color: #009900;">&#40;</span><span style="color: #000088;">$c</span><span style="color: #339933;">,</span> <span style="color: #000088;">$l</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$c</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/explode"><span style="color: #990000;">explode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$l</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$r</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$c</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">.</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$r</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'...'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Nota la &#8220;chicca&#8221; per non preoccuparsi di eliminare lo spazio in più <img src='http://www.undolog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Di: Giovambattista Fazioli</title>
		<link>http://www.undolog.com/2008/09/21/very-short-snippet-php-word-cut/#comment-1138</link>
		<dc:creator>Giovambattista Fazioli</dc:creator>
		<pubDate>Mon, 22 Sep 2008 12:12:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.undolog.com/?p=677#comment-1138</guid>
		<description>@Tom: oddio, un esempio per una funzione &quot;taglia stringhe&quot; è un po&#039; eccessivo... :) Tuttavia, ad esempio, la puoi usare per:
[cc_php]
$res = wordCut( &#039;Stringa di esempio abbastanza lunga per essere tagliata&#039;, 5 );
[/cc_php]
Otterai in &lt;code inline=&quot;true&quot;&gt;$res&lt;/code&gt;:
&lt;pre&gt;Stringa di esempio abbastanza lunga...&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>@Tom: oddio, un esempio per una funzione &#8220;taglia stringhe&#8221; è un po&#8217; eccessivo&#8230; <img src='http://www.undolog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Tuttavia, ad esempio, la puoi usare per:</p>
<div class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> wordCut<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Stringa di esempio abbastanza lunga per essere tagliata'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">5</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Otterai in <code class="codecolorer text default"><span class="text">$res</span></code>:</p>
<pre>Stringa di esempio abbastanza lunga...</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

