<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - FatFolderDesigner</title>
<link>http://snipplr.com/users/FatFolderDesigner/tags/dynamic</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Tue, 21 May 2013 06:51:00 GMT</pubDate>
<item>
<title>(PHP) PHP absolutely relative root</title>
<link>http://snipplr.com/view/44647/php-absolutely-relative-root/</link>
<description><![CDATA[ <p>After an attempt to more a live site to a personal server for further work I ran across the problem of a mix of absolut and relative links making the local copy not work. Not wanting to manually have to change every single absolute to a relative (because some files are called from multiple sources leading to time consuming  complicated conditional relative link) I looked for ways to simple "convert" my original absolutes to relatives and come up with this.

Basically, this adds the appropriate number of back links (../'s) so that it starts at your server root. This makes relative linking easier because they will always start from the same place no matter where you are or what file may be making the link.

This is just a first run of it, I know of some improvements that could be made (primarily, making it a class instead of a definition because once this is set it's stuck, causing it to work incorrectly at times) but this version works for basic sites.</p> ]]></description>
<pubDate>Mon, 22 Nov 2010 10:09:07 GMT</pubDate>
<guid>http://snipplr.com/view/44647/php-absolutely-relative-root/</guid>
</item>
</channel>
</rss>