title: PHP how to go one level up on dirname(__FILE__)
body: <p>I have a folder structure as follows:</p>
  <pre><code>mydomain.example
    -&gt;Folder-A
    -&gt;Folder-B
  </code></pre>
  <p>I have a string from Database that is <code>../Folder-B/image1.jpg</code>, which points to an image in <code>Folder-B</code>.</p>
  <p>Inside a script in <code>Folder-A</code>, I am using <code>dirname(__FILE__)</code> to fetch the filename and I get
  <code>mydomain.example/Folder-A</code>. Inside this script, I need to get a string that says <code>'mydomain.example/Folder-B/image1.jpg</code>. I tried</p>
  <pre><code>$path=dirname(__FILE__).'/'.'../Folder-B/image1.jpg';
  </code></pre>
  <p>This shows up as <code>mydomain.com%2FFolder-A%2F..%2FFolder-B%2Fimage1.jpg</code></p>
  <p>This is for a Facebook share button, and this fails to fetch the correct image. Anyone know how to get the path correctly?</p>
  <p>I hope to get a URL: <code>mydomain.example%2FFolder-B%2Fimage1.jpg</code></p>