This article introduces to you about how PHP to create a soft connection (code), there is a certain reference value, the need for friends can refer to, I hope to help you.
When accessing a file other than the WWW directory in the server, you can use the Create soft link method
function Newsymlink ($path) { $manual = $path; The original path $manualLink = './uploadsymlink/'. Date (' y-m-d h:i:s '); Soft connection Path $isExistFile = true; The identity if the original file exists (Is_file ($manual) &&!is_file ($manualLink)) { //the original file exists and the soft connection does not exist, create a soft connection symlink ($ Manual, $manualLink); Create soft Connection } if (!is_file ($manualLink)) { $isExistFile = false; } ElseIf (!is_file ($manual)) {//The original file does not exist $isExistFile = false; } Return Array (' isexistfile ' = $isExistFile, ' manual ' = ' $manualLink);}
Use $manuallink directly on the page.