<?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>NewSourceMedia Blog &#187; end</title>
	<atom:link href="http://newsourcemedia.com/blog/tag/end/feed/" rel="self" type="application/rss+xml" />
	<link>http://newsourcemedia.com/blog</link>
	<description>Focused on Interactive Design, Development and Marketing</description>
	<lastBuildDate>Wed, 11 Aug 2010 13:56:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP Remove last character from string</title>
		<link>http://newsourcemedia.com/blog/php-remove-last-character/</link>
		<comments>http://newsourcemedia.com/blog/php-remove-last-character/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 01:55:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[String Manipulation]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[character]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[end]]></category>
		<category><![CDATA[extract]]></category>
		<category><![CDATA[last]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[update.]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/?p=515</guid>
		<description><![CDATA[Want to remove the last character from your text. Just use Substr_Replace. This is how.
PHP&#8217;s substr_replace replaces text within a portion of a string. In this case we only want to replace the last character with nothing. Here is the code sample:

$old_string = &#34;My-Category-&#34;;
// remove the last hyphen from the string
$new_string = substr_replace&#40;$old_string,&#34;&#34;,-1&#41;;
echo $new_string;
// should [...]]]></description>
			<content:encoded><![CDATA[<p>Want to remove the last character from your text. Just use Substr_Replace. This is how.<span id="more-515"></span></p>
<p>PHP&#8217;s substr_replace replaces text within a portion of a string. In this case we only want to replace the last character with nothing. Here is the code sample:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$old_string</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;My-Category-&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// remove the last hyphen from the string</span>
<span style="color: #000088;">$new_string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$old_string</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">echo</span> <span style="color: #000088;">$new_string</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// should now read &quot;My-Category&quot;</span></pre></div></div>

<p>This should replace the last character of a string with nothing.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://newsourcemedia.com/blog/php-strip-remove-white-space-from-end-of-string/" rel="bookmark">PHP strip remove white space from end of string</a></li><li><a href="http://newsourcemedia.com/blog/php-remove-non-alphanumeric-characters/" rel="bookmark">Php Remove Non-Alphanumeric Characters</a></li><li><a href="http://newsourcemedia.com/blog/flash-string-search-replace-using-prototype/" rel="bookmark">Flash string search replace using prototype</a></li><li><a href="http://newsourcemedia.com/blog/php-replace-only-first-occurrence-of-a-string-match/" rel="bookmark">PHP replace only first occurrence of a string match.</a></li><li><a href="http://newsourcemedia.com/blog/php-validation-numbers-only-from/" rel="bookmark">PHP Validation Numbers Only From</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/php-remove-last-character/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->