title: Change relative link paths for included content in PHP
body: <p>I have a PHP file at my server root.. <strong>index.php</strong> .. which <a href="http://www.php.net/include/" rel="nofollow noreferrer"><code>include</code></a>'s .. DIR/<strong>main.php</strong></p>
  
  <p>Now .. DIR/<strong>main.php</strong> ..  has relative links to many nearby files.</p>
  
  <p>All the relative links are broken.</p>
  
  <hr>
  
  <p>Any way I can change the relative-URL base path <strong>for links?</strong></p>
  
  <p>... so the included content of  DIR/<strong>main.php</strong> has all its links to <strong>friend1.php</strong> changed to <strong>DIR/friend1.php</strong>.</p>
  
  <hr>
  
  <p>Edit: This in NOT about include's, this is about CHANGING ahref links en-masse.</p>