title: How to get an URL of an image which has been stored on server
body: <p>It must be very easy but I have no clue how to get the URL of an image from server.</p>
  
  <p>Lets say I have domain named www.example.com and the image has been stored in my </p>
  
  <pre><code>htdocs&gt;www&gt;resources&gt;userid&gt;images&gt;image.jpg
  </code></pre>
  
  <p>So, I want upload an image and save it through php script into my images folder and return the URL of that image back to browser like,</p>
  
  <pre><code>www.example.com/.../.../images/image.jpg
  </code></pre>
  
  <p>Is there any php function to get URL of a file?</p>
  
  <h2>EDIT:</h2>
  
  <p>After looking at answer I thought I should more clarify my self. I am really sorry for misunderstanding,</p>
  
  <p><strong>The help I wanted is to :</strong> what if the domain name isn't static I mean you can download and attach my image uploader plugin to your website but now it should dynamically get domain name and http path to your image.</p>