<?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>Thesis: Hosting &#187; PHP</title>
	<atom:link href="http://www.thesishosting.com/topics/php-topics/feed" rel="self" type="application/rss+xml" />
	<link>http://www.thesishosting.com</link>
	<description>Down &#38; Dirty Web Hosting Resource</description>
	<lastBuildDate>Mon, 21 Nov 2011 20:02:53 +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 Snippet: Display Last X Characters of a URL</title>
		<link>http://www.thesishosting.com/2010/02/topics/php-topics/php-snippet-display-last-x-characters-of-a-url</link>
		<comments>http://www.thesishosting.com/2010/02/topics/php-topics/php-snippet-display-last-x-characters-of-a-url#comments</comments>
		<pubDate>Fri, 26 Feb 2010 18:51:16 +0000</pubDate>
		<dc:creator>Dixie</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[code snippet]]></category>

		<guid isPermaLink="false">http://thesishosting.com/?p=341</guid>
		<description><![CDATA[PHP code snippet to return the last X number of characters from a URL string. From client request, but shared in case it's of use to others.]]></description>
			<content:encoded><![CDATA[<p><a class="post_image_link" href="http://www.thesishosting.com/2010/02/topics/php-topics/php-snippet-display-last-x-characters-of-a-url" title="Permanent link to PHP Snippet: Display Last X Characters of a URL"><img class="post_image alignnone" src="http://farm4.static.flickr.com/3025/2547900338_2d73dfa2f9.jpg" width="500" height="375" alt="PHP Code Snippet: Show Last X Charaters of URL String" /></a>
</p><p><span style="font-size: xx-small;color: #ccc"><br />
</span>Had a request to return the last 23 characters of a url. I am WAY not a coder, but was able to help modify this function to work. Of course, you probably won&#8217;t just want to echo the output, but use it as a variable for something else.</p>
<pre class="brush: php; title: ; notranslate">&lt;?php function curPageURL() {
$pageURL = 'http';
if ($_SERVER[&quot;HTTPS&quot;] == &quot;on&quot;) {$pageURL .= &quot;s&quot;;}
$pageURL .= &quot;://&quot;;
if ($_SERVER[&quot;SERVER_PORT&quot;] != &quot;80&quot;) {
$pageURL .= $_SERVER[&quot;SERVER_NAME&quot;].&quot;:&quot;.$_SERVER[&quot;SERVER_PORT&quot;].$_SERVER[&quot;REQUEST_URI&quot;];
} else {
$pageURL .= $_SERVER[&quot;SERVER_NAME&quot;].$_SERVER[&quot;REQUEST_URI&quot;];
}
return $pageURL;
}
echo substr(curpageURL(),-23);?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.thesishosting.com/2010/02/topics/php-topics/php-snippet-display-last-x-characters-of-a-url/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: www.thesishosting.com @ 2012-02-07 00:02:35 by W3 Total Cache -->
