<?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>Comments on: Rezanje teksta po koncu besede &#8211; php funkcija &#8211; substr &#8211; cut text &#8211; UTF-8</title>
	<atom:link href="http://www.trsplet.si/blog/2008/04/16/rezanje-teksta-po-koncu-besede-php-funkcija-substr-cut-text/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.trsplet.si/blog/2008/04/16/rezanje-teksta-po-koncu-besede-php-funkcija-substr-cut-text/</link>
	<description>Izdelava spletnih strani in trgovin</description>
	<lastBuildDate>Sat, 04 Feb 2012 20:41:02 +0200</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Roky</title>
		<link>http://www.trsplet.si/blog/2008/04/16/rezanje-teksta-po-koncu-besede-php-funkcija-substr-cut-text/comment-page-1/#comment-8095</link>
		<dc:creator>Roky</dc:creator>
		<pubDate>Mon, 14 Jul 2008 21:00:39 +0000</pubDate>
		<guid isPermaLink="false">http://trsplet.com/blog/?p=166#comment-8095</guid>
		<description>Dobra rešitev, mogoče celo boljša!</description>
		<content:encoded><![CDATA[<p>Dobra rešitev, mogoče celo boljša!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: G.V.</title>
		<link>http://www.trsplet.si/blog/2008/04/16/rezanje-teksta-po-koncu-besede-php-funkcija-substr-cut-text/comment-page-1/#comment-8010</link>
		<dc:creator>G.V.</dc:creator>
		<pubDate>Fri, 11 Jul 2008 21:33:33 +0000</pubDate>
		<guid isPermaLink="false">http://trsplet.com/blog/?p=166#comment-8010</guid>
		<description>Jaz uporabljam tole:

[php]
function cutText($text=&quot;&quot;, $length=15) {
$words = explode(&#039; &#039;, $text, $length + 1);
	if (count($words) &gt; $length) {
		array_pop($words);
		array_push($words, &#039;...&#039;);
		$text = implode(&#039; &#039;, $words);
	}
return $text;
}
[/php]</description>
		<content:encoded><![CDATA[<p>Jaz uporabljam tole:</p>
<div class="igBar"><span id="lphp-1"><a href="#" onclick="javascript:showPlainTxt('php-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-1">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> cutText<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$text</span>=<span style="color:#FF0000;">""</span>, <span style="color:#0000FF;">$length</span>=<span style="color:#CC66CC;color:#800000;">15</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$words</span> = <a href="http://www.php.net/explode"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">' '</span>, <span style="color:#0000FF;">$text</span>, <span style="color:#0000FF;">$length</span> + <span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/count"><span style="color:#000066;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$words</span><span style="color:#006600; font-weight:bold;">&#41;</span>&amp;gt; <span style="color:#0000FF;">$length</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array_pop"><span style="color:#000066;">array_pop</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$words</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array_push"><span style="color:#000066;">array_push</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$words</span>, <span style="color:#FF0000;">'...'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$text</span> = <a href="http://www.php.net/implode"><span style="color:#000066;">implode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">' '</span>, <span style="color:#0000FF;">$words</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">return</span> <span style="color:#0000FF;">$text</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PHP - delo z UTF-8 stringi oz. podatki - težave s šumniki (č,š,ž) &#124; .: TRSplet - internetne storitve .:</title>
		<link>http://www.trsplet.si/blog/2008/04/16/rezanje-teksta-po-koncu-besede-php-funkcija-substr-cut-text/comment-page-1/#comment-4533</link>
		<dc:creator>PHP - delo z UTF-8 stringi oz. podatki - težave s šumniki (č,š,ž) &#124; .: TRSplet - internetne storitve .:</dc:creator>
		<pubDate>Tue, 03 Jun 2008 22:01:19 +0000</pubDate>
		<guid isPermaLink="false">http://trsplet.com/blog/?p=166#comment-4533</guid>
		<description>[...] cuttext, substr [...]</description>
		<content:encoded><![CDATA[<p>[...] cuttext, substr [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PHP - pretvori prvo črko v veliko črko - UTF8 podpora (ucfirst, ucwords, mb_convert_case) &#124; .: TRSplet - internetne storitve .:</title>
		<link>http://www.trsplet.si/blog/2008/04/16/rezanje-teksta-po-koncu-besede-php-funkcija-substr-cut-text/comment-page-1/#comment-4352</link>
		<dc:creator>PHP - pretvori prvo črko v veliko črko - UTF8 podpora (ucfirst, ucwords, mb_convert_case) &#124; .: TRSplet - internetne storitve .:</dc:creator>
		<pubDate>Mon, 02 Jun 2008 11:14:21 +0000</pubDate>
		<guid isPermaLink="false">http://trsplet.com/blog/?p=166#comment-4352</guid>
		<description>[...] Kot veste php funkciji ucfirst in ucwords ne delujeta pravilno, če imamo v tekstu posebne znake (kot naprimer šumniki (č,š,ž) v UTF8 formatu). Podobne težave nastopijo tudi pri ostalih funkcijah, naprimer substr ter strtolower. [...]</description>
		<content:encoded><![CDATA[<p>[...] Kot veste php funkciji ucfirst in ucwords ne delujeta pravilno, če imamo v tekstu posebne znake (kot naprimer šumniki (č,š,ž) v UTF8 formatu). Podobne težave nastopijo tudi pri ostalih funkcijah, naprimer substr ter strtolower. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roky</title>
		<link>http://www.trsplet.si/blog/2008/04/16/rezanje-teksta-po-koncu-besede-php-funkcija-substr-cut-text/comment-page-1/#comment-385</link>
		<dc:creator>Roky</dc:creator>
		<pubDate>Thu, 17 Apr 2008 13:54:08 +0000</pubDate>
		<guid isPermaLink="false">http://trsplet.com/blog/?p=166#comment-385</guid>
		<description>Ja, isti problem ker so byti po indexah in pol narobe ven dobi ..</description>
		<content:encoded><![CDATA[<p>Ja, isti problem ker so byti po indexah in pol narobe ven dobi ..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carli</title>
		<link>http://www.trsplet.si/blog/2008/04/16/rezanje-teksta-po-koncu-besede-php-funkcija-substr-cut-text/comment-page-1/#comment-383</link>
		<dc:creator>Carli</dc:creator>
		<pubDate>Thu, 17 Apr 2008 13:44:23 +0000</pubDate>
		<guid isPermaLink="false">http://trsplet.com/blog/?p=166#comment-383</guid>
		<description>O tem se že pisal nekje, čeprav je šlo samo za to, da se iz besede odreže prve 3 črke in naredi prvo uppercase. No vse lepo in prav, dokler ne pridemo do multibyte črke.

Šlo je za to:
&lt;code&gt;
$text = mb_substr(&quot;človek&quot;,0,3);
$text[0] = mb_strtoupper($text[0], &quot;UTF-8&quot;);
&lt;/code&gt;

Škoda teh funkcij zaradi čžš ... :D</description>
		<content:encoded><![CDATA[<p>O tem se že pisal nekje, čeprav je šlo samo za to, da se iz besede odreže prve 3 črke in naredi prvo uppercase. No vse lepo in prav, dokler ne pridemo do multibyte črke.</p>
<p>Šlo je za to:<br />
<code><br />
$text = mb_substr("človek",0,3);<br />
$text[0] = mb_strtoupper($text[0], "UTF-8");<br />
</code></p>
<p>Škoda teh funkcij zaradi čžš ... <img src='http://www.trsplet.si/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boštjan</title>
		<link>http://www.trsplet.si/blog/2008/04/16/rezanje-teksta-po-koncu-besede-php-funkcija-substr-cut-text/comment-page-1/#comment-374</link>
		<dc:creator>Boštjan</dc:creator>
		<pubDate>Wed, 16 Apr 2008 17:29:36 +0000</pubDate>
		<guid isPermaLink="false">http://trsplet.com/blog/?p=166#comment-374</guid>
		<description>Narobe je uglaunem vrnila funkcija - pa ni bla točno ta ki je zgoraj, ker je nism poslal na php.net ;)</description>
		<content:encoded><![CDATA[<p>Narobe je uglaunem vrnila funkcija - pa ni bla točno ta ki je zgoraj, ker je nism poslal na php.net <img src='http://www.trsplet.si/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roky</title>
		<link>http://www.trsplet.si/blog/2008/04/16/rezanje-teksta-po-koncu-besede-php-funkcija-substr-cut-text/comment-page-1/#comment-364</link>
		<dc:creator>Roky</dc:creator>
		<pubDate>Wed, 16 Apr 2008 07:33:08 +0000</pubDate>
		<guid isPermaLink="false">http://trsplet.com/blog/?p=166#comment-364</guid>
		<description>Ja, echo $string[1], vrne ?, ker je dobu sam prvi byte znaka. 

Tut jest sem mislu da sem sam napisov sam ko sem mal pogledov na php.net, sem vidu da ma eden skorej isto tko da se mi zazdel da sem njegovo kodo uporabu za začetek:)</description>
		<content:encoded><![CDATA[<p>Ja, echo $string[1], vrne ?, ker je dobu sam prvi byte znaka. </p>
<p>Tut jest sem mislu da sem sam napisov sam ko sem mal pogledov na php.net, sem vidu da ma eden skorej isto tko da se mi zazdel da sem njegovo kodo uporabu za začetek:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boštjan</title>
		<link>http://www.trsplet.si/blog/2008/04/16/rezanje-teksta-po-koncu-besede-php-funkcija-substr-cut-text/comment-page-1/#comment-363</link>
		<dc:creator>Boštjan</dc:creator>
		<pubDate>Wed, 16 Apr 2008 06:14:27 +0000</pubDate>
		<guid isPermaLink="false">http://trsplet.com/blog/?p=166#comment-363</guid>
		<description>A zato sm meu jst probleme pr zgornji funkciji :) (sm jo sicer sam napisu)</description>
		<content:encoded><![CDATA[<p>A zato sm meu jst probleme pr zgornji funkciji <img src='http://www.trsplet.si/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  (sm jo sicer sam napisu)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

