• notice
  • Congratulations on the launch of the Sought Tech site

A good function realpath that takes the full path by file name

span class="pln">$system_path, '/'< /span>).'/'; } realpath() expands all symbolic links and handles the'/./','/../ in the input path 'And the extra'/' and return the normalized absolute path name.There are no symbolic links,'/./' or'/../' components in the returned path.

realpath() returns FALSE when it fails, for example, if the file does not exist.On BSD systems, if only path does not exist, PHP will not return FALSE like other systems.

Very easy to use, make a mark for realpath.The following is the execution result on Linux and Windows, there will be a little difference, pay attention to the slash and double slash at the end:

                  

Tags

Technical otaku

Sought technology together

Related Topic

0 Comments

Leave a Reply

+