Relative urls / paths in php

Hi, this is the first time I ask a question here.

I have an src image like

src="images//images/pixel.gif" 

But I do not understand this double slash ( // ) in src.

Also, what is the meaning of " ./ " and " ../ " in the relative path to the file, for example, below src:

src="./images/pixel.gif" 
src="../images/pixel.gif" 
+3
source share
2 answers

Starting /means the root of the web page.

An entry in a directory with the name .means the same directory. If this is the beginning, it usually means something like “here” and is mainly used to clarify that the path refers to a given location.

.. . , , .

/ , -.

,

src="images//images/pixel.gif" /images/pixel.gif ( , images, .

src="./images/pixel.gif" images , (, ). . src="images/pixel.gif".

src="../images/pixel.gif" , , images. .

!

+7
  • // , /.
  • '' ".." .

    /app/test/files/somefile.php, /app/test/files/another.php, /app/test/css/somecss.css

somecss.css somefile.php, , .

../css/somecss.css → , css , , somecss.css

, another.php,

./another.php another.php

+5

All Articles