title: PHP Parse HTML img tag src path not working
body: <p>i have some code in HTML that gets parsed by PHP, and i want the image tags to be relative, because the code needs to work on multiple servers.</p>
  
  <p>I have <code>index.php</code> in the directory as the folder <code>icons</code>, and in <code>icons</code>, there is an image called <code>logo.png</code>. The code is <code>index.php</code> is like this:</p>
  
  <pre><code>echo '&lt;img src="icons/logo.png"&gt;';
  </code></pre>
  
  <p>But does not work. However, if i change it to this kind of path (<code>http://mydomain...</code>) it does work.</p>
  
  <p>On one of the servers, both <code>index.php</code> and <code>icons</code> are in a subdomain directory, and on the other server they are in the root. In both cases the relative path does not work.</p>
  
  <p>How can i fix this?</p>
  
  <p>Thanks.</p>
  
  <p>EDIT: In my HTML inspector, i can see that the URL to the image is correctly being parsed.</p>