<?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>Mon, 07 May 2012 01:26:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<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'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 &#8230; <a href="http://newsourcemedia.com/blog/php-remove-last-character/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Want to remove the last character from your text. Just use Substr_Replace. This is how.<span id="more-515"></span>

PHP'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:

<pre lang="php">$old_string = "My-Category-";
// remove the last hyphen from the string
$new_string = substr_replace($old_string,"",-1);
echo $new_string;
// should now read "My-Category"
</pre>
This should replace the last character of a string with nothing.]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/php-remove-last-character/feed/</wfw:commentRss>
		<slash:comments>3</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! -->
