Home > Backend Development > PHP Tutorial > PHP access network shared resources and local files_PHP tutorial

PHP access network shared resources and local files_PHP tutorial

WBOY
Release: 2016-07-13 17:52:27
Original
1268 people have browsed it

[php]

$filename = "D:/pic_gather/figure/1.png";
$size = filesize($filename);
echo $size;
       
?>

The company has banned the internet, but my work requires external access, so I can only use the company’s public computers. Use your own computer to operate him remotely (you can actually use a proxy, but this method is not used). So some files are on the public machine. However, because I am lazy and don't want to take exams, I choose the folder to be accessed, set it as shared, and then access it with php.

The simple test code is as follows:

The above code implements reading the size of the 1.png file in the pic_gather/figure path shared on a public computer.
Note that the diagonal bar here can only be used with "/" otherwise the access will not be successful. It is also best to use this, so as to make your code compatible with Linux.

Access local resources, the code is as follows:

[php]

$filename = "D:/pic_gather/figure/1.png";
$size = filesize($filename);
echo $size;
       
?>


Author: wolinxuebin

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478125.htmlTechArticle[php] meta http-equiv=Content-Typecontent=text/html;charset=GBK ?php $filename = D:/pic_gather/figure/1.png; $size = filesize($filename); echo $size; ? The company blocks the Internet, but my work...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template